Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Include Login Hint in Authentication Properties #3452

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

craigbroadman
Copy link

By including the login hint in Authentication Properties, I am able to access the value to pass to an external IdP.

Example here....

http://stackoverflow.com/questions/24957152/owin-pass-custom-query-parameters-in-authentication-request

@dnfclas
Copy link

dnfclas commented Jan 13, 2017

Hi @craigbroadman, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla2.dotnetfoundation.org.

TTYL, DNFBOT;

@brockallen
Copy link
Member

I don't think you need this change. Can't you access the signin message in your event callback on the OIDC middleware?

@craigbroadman
Copy link
Author

If that is possible then yes, that would solve this issue. Could you provide me an example of accessing the signin message in the event callback on the OIDC middleware?

@brockallen
Copy link
Member

I don't have code off hand, but you can call the OWIN extensions we provide in the callback. https://identityserver.github.io/Documentation/docsv2/advanced/owin.html

@brockallen
Copy link
Member

Something like this:

                Notifications = new OpenIdConnectAuthenticationNotifications
                {
                    RedirectToIdentityProvider = ctx =>
                    {
                        var signinId = ctx.OwinContext.Request.Query["signin"];
                        var msg = ctx.OwinContext.Environment.GetSignInMessage(signinId);
                        var hint = msg.LoginHint;
                        return Task.FromResult(0);
                    }
                }

@brockallen
Copy link
Member

Can we close this?

@craigbroadman
Copy link
Author

Yes, this can be closed, thank you very much for your help.

@dnfclas
Copy link

dnfclas commented Jan 16, 2017

Hi @craigbroadman, I'm your friendly neighborhood .NET Foundation Pull Request Bot (You can call me DNFBOT). Thanks for your contribution!

In order for us to evaluate and accept your PR, we ask that you sign a contribution license agreement. It's all electronic and will take just minutes. I promise there's no faxing. https://cla2.dotnetfoundation.org.

TTYL, DNFBOT;

@craigbroadman
Copy link
Author

craigbroadman commented Jan 16, 2017

Although the above code does give me access to the login hint as required, including the "login_hint" in the dictionary (as per the pull request) means that the Google implementation works out of the box without creating a custom provider...

Please see https://katanaproject.codeplex.com/SourceControl/latest#src/Microsoft.Owin.Security.Google/GoogleOAuth2AuthenticationHandler.cs

What are your thoughts?

@ghost ghost removed the cla-required label Dec 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants