Social logins / OAuth
Configuration
Providers configuration is located in Aufy:Providers
section of your appsettings file.
Aufy provides pre-configured authentication schemes for GitHub
and Discord
.
Configuring OAuth providers
To configure OAuth provider using Aufy helpers, add a new section to Aufy:Providers
section of your appsettings file.
Next register OAuth Scheme using Aufy helpers.
AddProvider
method will execute only if section with specified name exists inAufy:Providers
section of your appsettings file.Configure
method will apply specified options fromAufy:Providers
section of your appsettings file and some defaults required by Aufy:ClientId
andClientSecret
options are required.Scopes
CallbackPath
in{ApiBasePath}/external/callback/{Provider}
format. For example:/auth/external/callback/google
. You have to configure this callback path in your OAuth provider dashboard.- Cookie
SingInScheme
used later for final sign in/sign up. The value isAufy.ExternalSignInDefaultScheme
. - OAuth.Events.OnCreatingTicket set to internal Aufy handler that checks if user exists. If user exist it creates special sign in cookies. Otherwise, it creates a special sign up cookie and adds query parameter
signup=true
to the callback URL.