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

Persist custom returned claims (id_token/id_token_hint) #92

Open
mistyn8 opened this issue May 15, 2018 · 2 comments
Open

Persist custom returned claims (id_token/id_token_hint) #92

mistyn8 opened this issue May 15, 2018 · 2 comments

Comments

@mistyn8
Copy link

mistyn8 commented May 15, 2018

Sorry for the loads of requests..

So still on with identity server 4, and trying to sort the logout.. In order to do that, I need to pass the id_token_hint returned from the original authentication.

I can see it being returned and can store it against the umbraco member profile at the ExternalLoginConfirmation callback

info.ExternalIdentity.Claims.FirstOrDefault(c => c.Type == "id_token_hint").Value

but should this really be stored in the user.Indentity.claims collection, which looks like it strips any of the claims returned other than the specific umbraco mapped ones?

Again any help in this regard really appreciated. :-)

@stokesy43
Copy link

In my article https://pstokes.co.uk/posts/umbraco-members-and-identity-server-part-3/

I show how to store claims returned back from identity server in the local identity without the need for a umbraco member. You would then be able to store the id_token_hint claim locally and use it in the RedirectToIdentityProvider notification event. Something like this:

RedirectToIdentityProvider = n =>
                    {
                        // if signing out, add the id_token_hint
                        if (n.ProtocolMessage.RequestType == OpenIdConnectRequestType.LogoutRequest)
                        {
                            var idTokenHint = n.OwinContext.Authentication.User.FindFirst("id_token");

                            if (idTokenHint != null)
                            {
                                n.ProtocolMessage.IdTokenHint = idTokenHint.Value;
                            }

                        }

                        return Task.FromResult(0);
                    }

@Shazwazza
Copy link
Owner

If anyone could help out with this project to get this done automatically and always working for any provider let me know. I "think" this is basically the same topic as this? #56 (comment)

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

No branches or pull requests

3 participants