После успешного входа в систему некоторые пользователи перенаправляют на URL-адрес redirect: https://example.com/signin-oidcобразно /> correlation_error
Если пользователь обновляет URL и удаляет Signin-oidc , поэтому они теперь просто переходят на https://example.com они успешно вошли на домашнюю страницу. PrettyPrint-Override ">
Код: Выделить всё
"AzureAdB2C": {
"Instance": "https://my-b2c.b2clogin.com",
"ClientId": "",
"Domain": "my-b2c.onmicrosoft.com",
"ObjectId": "",
"TenantId": "",
"ClientSecret": "",
"CallbackPath": "/signin-oidc",
"SignUpSignInPolicyId": "B2C_1_MyB2C_SignIn",
"SignedOutCallbackPath": "/signout",
}
b2c-url < /p>
Вот моя аутентификация регистрации приложения B2 Переменные/приложения:
if (!string.IsNullOrEmpty(builder.Configuration.GetValue($"{authType}:CustomRedirectBaseUrl")))
{
var redirectUrlBase = builder.Configuration.GetValue($"{authType}:CustomRedirectBaseUrl");
var redirectUrl = redirectUrlBase + builder.Configuration.GetValue($"{authType}:CallbackPath");
logger.LogInformation($"Custom redirect url is found: {redirectUrl}");
builder.Services.Configure(OpenIdConnectDefaults.AuthenticationScheme, opts =>
{
opts.Events = new OpenIdConnectEvents
{
OnRedirectToIdentityProvider = async context =>
{
logger.LogInformation($"OnRedirectToIdentityProvider: RedirectUri set to '{redirectUrl}'");
context.ProtocolMessage.RedirectUri = redirectUrl;
await Task.Yield();
},
OnRedirectToIdentityProviderForSignOut = async context =>
{
logger.LogInformation($"OnRedirectToIdentityProviderForSignOut: PostLogoutRedirectUri set to '{redirectUrlBase}'");
context.ProtocolMessage.PostLogoutRedirectUri = redirectUrlBase;
await Task.Yield();
}
};
});
}
< /code>
my url-url в переменных среды (веб-приложение Azure):
env-variables < /p>
Вот мои журналы, показывающие, что система настраивает URL Redirect:
< /p>
Подробнее здесь: https://stackoverflow.com/questions/794 ... direct-url