Как избежать лазурного кода B2C от принятия учетных данных Windows - PullRequest
0 голосов
/ 04 июня 2019

Мы интегрировали наше приложение с активным каталогом Azure B2C.Поэтому мы использовали необходимый код для считывания учетных данных в нашем приложении.Но мы заметили, что код читает учетные данные Windows по умолчанию, поэтому, даже если мы вручную введем несколько других учетных данных, приложение будет входить в систему как пользователь учетных данных Windows.

    public void ConfigureAuth(IAppBuilder app)
    {

        ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

        app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType);

        app.UseCookieAuthentication(new CookieAuthenticationOptions());

        app.UseOpenIdConnectAuthentication(
            new OpenIdConnectAuthenticationOptions
            {
                // Generate the metadata address using the tenant and policy information
                MetadataAddress = String.Format(MSALSessionCache.AadInstance, MSALSessionCache.Tenant, MSALSessionCache.DefaultPolicy),

                // These are standard OpenID Connect parameters, with values pulled from web.config
                ClientId = MSALSessionCache.ClientId,
                RedirectUri = MSALSessionCache.RedirectUri,
                PostLogoutRedirectUri = MSALSessionCache.RedirectUri,

                // Specify the callbacks for each type of notifications
                Notifications = new OpenIdConnectAuthenticationNotifications
                {
                    RedirectToIdentityProvider = OnRedirectToIdentityProvider,
                    AuthorizationCodeReceived = OnAuthorizationCodeReceived,
                    AuthenticationFailed = OnAuthenticationFailed,
                },

                // Specify the claim type that specifies the Name property.
                TokenValidationParameters = new TokenValidationParameters
                {
                    NameClaimType = "name"
                },

                // Specify the scope by appending all of the scopes requested into one string (separated by a blank space)
                Scope = "openid profile offline_access " + MSALSessionCache.ReadTasksScope + " " + MSALSessionCache.WriteTasksScope
            }
        );
    }

Мы ожидаем, что код получит учетные данныекоторый предоставляется пользователем вместо того, чтобы брать из окон вошедшего в систему пользователя.Есть ли способ настроить функциональность по умолчанию.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...