Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Added overload of AddKeycloakWebAppAuthentication #146

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

awchristie1
Copy link

Added overload of AddKeycloakWebAppAuthentication due to dotnet 8.0 causing breaking changes. The sub claim is not mapped into the user's claims list without disabling claimMapping. Exposing the ConfigureOpenIdConnectionOptions allows this to be worked around.

…ausing breaking changes. The sub claim is not mapped into the user's claims list without disabling claimMapping. Exposing the ConfigureOpenIdConnectionOptions allows this to be worked around
string configSectionName = KeycloakAuthenticationOptions.Section,
string openIdConnectScheme = OpenIdConnectDefaults.AuthenticationScheme,
string cookieScheme = CookieAuthenticationDefaults.AuthenticationScheme,
Action<OpenIdConnectOptions>? configureOpenIdConnectOptions=null,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix formatting

@NikiforovAll
Copy link
Owner

Maybe we should include this workaround into core of this library instead of adding workaround?

@awchristie1
Copy link
Author

Maybe we should include this workaround into core of this library instead of adding workaround?

Link to changes: https://learn.microsoft.com/en-us/dotnet/core/compatibility/aspnet-core/8.0/securitytoken-events

However, this was what i used to get the original claims from keycloak with the new overload:

builder.Services
    .AddKeycloakWebAppAuthentication(builder.Configuration, 
        configureOpenIdConnectOptions: options => { 
            options.MapInboundClaims = false;  
            options.SaveTokens = true;  // for logout
        }) ;

@NikiforovAll
Copy link
Owner

Please do not delete build.yml

@NikiforovAll
Copy link
Owner

@awchristie1 could you please rebase to main and not remove build.yml?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants