Ejemplo n.º 1
0
        public AuthenticationScheme Create(MicrosoftIdentityProvider identityProvider)
        {
            var options = _micAuthOptions.CreateOptions(identityProvider.Alias);

            options.ClientId     = identityProvider.ClientId;
            options.ClientSecret = identityProvider.ClientSecret;

            return(new AuthenticationScheme(identityProvider.Alias, identityProvider.Alias, typeof(MicrosoftAccountHandler)));
        }
Ejemplo n.º 2
0
        public AuthenticationScheme Create(GoogleIdentityProvider identityProvider)
        {
            var options = _googleAuthOptionsBuilder.CreateOptions(identityProvider.Alias);

            options.ClientId     = identityProvider.ClientId;
            options.ClientSecret = identityProvider.ClientSecret;

            return(new AuthenticationScheme(identityProvider.Alias, identityProvider.Alias, typeof(GoogleHandler)));
        }
Ejemplo n.º 3
0
        public AuthenticationScheme Create(AzureAdIdentityProvider identityProvider)
        {
            var options = _openIdConnectAuthOptions.CreateOptions(identityProvider.Alias);

            options.Authority    = $"https://login.microsoftonline.com/{identityProvider.TenantId}";
            options.ClientId     = identityProvider.ClientIdGroupAzureAd;
            options.ClientSecret = identityProvider.ClientSecretGroupAzureAd;
            options.CallbackPath = "/auth/signin-callback";
            options.TokenValidationParameters.NameClaimType = "name";
            options.TokenValidationParameters.ValidAudience = identityProvider.ClientIdGroupAzureAd;

            options.MetadataAddress = AuthenticationConstants.GetOidcMetadataAddress(options.Authority);

            options.ConfigurationManager = CreateOidcConfigurationManager(
                options.BackchannelHttpHandler,
                options.BackchannelTimeout,
                options.MetadataAddress,
                options.RequireHttpsMetadata);

            options.Validate();

            return(new AuthenticationScheme(identityProvider.Alias, identityProvider.Alias, typeof(OpenIdConnectHandler)));
        }