Hi anonymous user ，
I would suggest you use CSOM in the .Net Core to assign/create/revoke customized site permission levels to users/groups. You could refer to this official documentation: https://learn.microsoft.com/en-us/sharepoint/dev/sp-add-ins/using-csom-for-dotnet-standard#authenticationmanager-sample-class
You have to use modern authentication with CSOM in .Net Core. To get access token, the recommended approach for getting access tokens for SharePoint Online is by setting up an Azure AD application
Besides, you could use PnP Core SDK in your solution which is more convinent for you. Below article would help you:
If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.