You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Has anyone integrated authentication and authorization with Keycloak?
I have tried with cookie and oidc, and it open the SSO page, and retrieves the cookie, but 'PageAuthorize' attribute does not recognize it as well as 'Serenity.Authorization'.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi all,
Has anyone integrated authentication and authorization with Keycloak?
I have tried with cookie and oidc, and it open the SSO page, and retrieves the cookie, but 'PageAuthorize' attribute does not recognize it as well as 'Serenity.Authorization'.
services.AddAuthentication(options =>
{
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
})
.AddCookie()
.AddOpenIdConnect(options =>
{
options.Authority = Configuration["Oidc:Authority"];
options.ClientId = Configuration["Oidc:ClientId"];
options.ClientSecret = Configuration["Oidc:ClientSecret"];
options.SaveTokens = true;
options.ResponseType = OpenIdConnectResponseType.Code;
options.RequireHttpsMetadata = true;
options.Scope.Add("openid");
options.Scope.Add("profile");
options.Scope.Add("email");
options.SaveTokens = true;
options.TokenValidationParameters = new TokenValidationParameters
{
ValidateIssuer = true
};
options.AuthenticationMethod = OpenIdConnectRedirectBehavior.FormPost;
options.ForwardSignIn = OpenIdConnectDefaults.AuthenticationScheme;
options.ForwardSignOut = OpenIdConnectDefaults.AuthenticationScheme;
});
Thank you in advance.
Kind Regars
Beta Was this translation helpful? Give feedback.
All reactions