Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

GetAuthorizationContextAsync fails to parse the IdP value? #89

Closed
mdmoura opened this issue Sep 17, 2020 · 0 comments
Closed

GetAuthorizationContextAsync fails to parse the IdP value? #89

mdmoura opened this issue Sep 17, 2020 · 0 comments

Comments

@mdmoura
Copy link

mdmoura commented Sep 17, 2020

I am using oidc-client-js to start the sign in process with IS4:

    UserManager.signinRedirect({ acr_values: 'IdP:Google' }));

Then on the AccountController's BuildLoginViewModelAsync there is the following:

        var context = await _interaction.GetAuthorizationContextAsync(returnUrl);
        if (context?.IdP != null && await _schemeProvider.GetSchemeAsync(context.IdP) != null)
        {
            var local = context.IdP == IdentityServer4.IdentityServerConstants.LocalIdentityProvider;

            // this is meant to short circuit the UI and only trigger the one external IdP
            var vm = new LoginViewModel
            {
                EnableLocalLogin = local,
                ReturnUrl = returnUrl,
                Username = context?.LoginHint,
            };

            if (!local)
            {
                vm.ExternalProviders = new[] { new ExternalProvider { AuthenticationScheme = context.IdP } };
            }

            return vm;
        }

If I am not wrong this checks if an IdP was provided in AcrValues and if yes then use that External IdP.

I passed the IdP Google but when I debugged context value on IdentityServer I got:

Screenshot 2020-09-17 at 17 28 14

The AcrValues is parsed but the property IdP is not defined. So the previous code fails to determine the IdP.

Am I sending 'IdP:Google' the wrong way? Do I need extra code in the Quickstart?

Or is GetAuthorizationContextAsync failing to parse correctly the AcrValues?

@mdmoura mdmoura closed this as completed Sep 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant