As already mentioned by Mark the best way is to use configuration from Sitecore.
Keep in mind the following parts:
- IdentityProvidersProcessorIdentityProvidersProcessor
-- here you can set your authentication settings
and configure your app to use the specific authentication like: "args.App.UseGoogleAuthentication(googleAuthOptions);"
args.App.UseGoogleAuthentication(googleAuthOptions);
- AuthenticationMiddlewareAuthenticationMiddleware - you can use Nuget packages like "Microsoft.Owin.Security.Google"
Microsoft.Owin.Security.Google
Optional you if you have a custom claim that needs to be linked for a user as identifier you can use Sitecore.Owin.Authentication.Services.DefaultExternalUserBuilderSitecore.Owin.Authentication.Services.DefaultExternalUserBuilder
, here you can override the CreateUniqueUserNameCreateUniqueUserName
.