#1 : Il a perdu s'est crampté.
This commit is contained in:
@@ -26,7 +26,8 @@
|
|||||||
{
|
{
|
||||||
RedirectUri = "/",
|
RedirectUri = "/",
|
||||||
},
|
},
|
||||||
CookieAuthenticationDefaults.AuthenticationScheme);
|
CookieAuthenticationDefaults.AuthenticationScheme,
|
||||||
|
OpenIdConnectDefaults.AuthenticationScheme);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet("/account/access-denied")]
|
[HttpGet("/account/access-denied")]
|
||||||
|
|||||||
@@ -260,6 +260,12 @@ try
|
|||||||
|
|
||||||
OnRedirectToIdentityProviderForSignOut = context =>
|
OnRedirectToIdentityProviderForSignOut = context =>
|
||||||
{
|
{
|
||||||
|
var idToken = context.HttpContext.User.FindFirst("id_token")?.Value;
|
||||||
|
if (!string.IsNullOrWhiteSpace(idToken))
|
||||||
|
{
|
||||||
|
context.ProtocolMessage.IdTokenHint = idToken;
|
||||||
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(publicOrigin))
|
if (!string.IsNullOrWhiteSpace(publicOrigin))
|
||||||
{
|
{
|
||||||
context.ProtocolMessage.PostLogoutRedirectUri = publicOrigin + context.Options.SignedOutCallbackPath;
|
context.ProtocolMessage.PostLogoutRedirectUri = publicOrigin + context.Options.SignedOutCallbackPath;
|
||||||
@@ -273,6 +279,12 @@ try
|
|||||||
var identity = (ClaimsIdentity)context.Principal!.Identity!;
|
var identity = (ClaimsIdentity)context.Principal!.Identity!;
|
||||||
var clientId = context.Options.ClientId;
|
var clientId = context.Options.ClientId;
|
||||||
|
|
||||||
|
if (context.SecurityToken is JwtSecurityToken idToken &&
|
||||||
|
!string.IsNullOrWhiteSpace(idToken.RawData))
|
||||||
|
{
|
||||||
|
identity.AddClaim(new Claim("id_token", idToken.RawData));
|
||||||
|
}
|
||||||
|
|
||||||
AddKeycloakRolesFromClaims(identity, context.Principal, clientId);
|
AddKeycloakRolesFromClaims(identity, context.Principal, clientId);
|
||||||
AddKeycloakRolesFromAccessToken(identity, context.TokenEndpointResponse?.AccessToken, clientId);
|
AddKeycloakRolesFromAccessToken(identity, context.TokenEndpointResponse?.AccessToken, clientId);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user