예제 #1
0
        public static MicrosoftIdentityWebAppAuthenticationBuilder AddMicrosoftWebAppCallsWebApi(
            this MicrosoftIdentityWebAppAuthenticationBuilder builder,
            IEnumerable <string>?initialScopes,
            Action <MicrosoftIdentityOptions> configureMicrosoftIdentityOptions,
            Action <ConfidentialClientApplicationOptions> configureConfidentialClientApplicationOptions,
            string openIdConnectScheme = OpenIdConnectDefaults.AuthenticationScheme)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            if (configureMicrosoftIdentityOptions == null)
            {
                throw new ArgumentNullException(nameof(configureMicrosoftIdentityOptions));
            }

            if (configureConfidentialClientApplicationOptions == null)
            {
                throw new ArgumentNullException(nameof(configureConfidentialClientApplicationOptions));
            }

            MicrosoftIdentityWebAppAuthenticationBuilder.WebAppCallsWebApiImplementation(
                builder.Services,
                initialScopes,
                configureMicrosoftIdentityOptions,
                openIdConnectScheme,
                configureConfidentialClientApplicationOptions);
            return(builder);
        }
예제 #2
0
 private static MicrosoftIdentityWebAppAuthenticationBuilder AddMicrosoftWebAppCallsWebApi(
     this MicrosoftIdentityWebAppAuthenticationBuilder builder,
     IConfiguration configuration,
     string configSectionName   = Constants.AzureAd,
     string openIdConnectScheme = OpenIdConnectDefaults.AuthenticationScheme)
 {
     return(builder.AddMicrosoftWebAppCallsWebApi(
                null,
                options => configuration.Bind(configSectionName, options),
                options => configuration.Bind(configSectionName, options),
                openIdConnectScheme));
 }
예제 #3
0
 public static MicrosoftIdentityWebAppAuthenticationBuilder AddMicrosoftWebAppCallsWebApi(
     this MicrosoftIdentityWebAppAuthenticationBuilder builder,
     IConfiguration configuration,
     IEnumerable <string> initialScopes,
     string configSectionName   = Constants.AzureAd,
     string openIdConnectScheme = OpenIdConnectDefaults.AuthenticationScheme)
 {
     return(builder.AddMicrosoftWebAppCallsWebApi(
                initialScopes,
                options => configuration.Bind(configSectionName, options),
                options => configuration.Bind(configSectionName, options),
                openIdConnectScheme));
 }