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

External IdP shortcut for Login missing DisplayName #1682

Open
YC opened this issue Sep 30, 2024 · 0 comments
Open

External IdP shortcut for Login missing DisplayName #1682

YC opened this issue Sep 30, 2024 · 0 comments
Assignees
Labels
area/templates Related to Templates

Comments

@YC
Copy link

YC commented Sep 30, 2024

In the shortcut code for displaying only 1 external IdP, the DisplayName property is not set.

if (!local)
{
    View.ExternalProviders = new[] { new ViewModel.ExternalProvider ( authenticationScheme: context.IdP ) };
}

https://github.com/DuendeSoftware/IdentityServer.Templates/blob/main/src/IdentityServerAspNetIdentity/Pages/Account/Login/Index.cshtml.cs#L172

It is therefore not included in VisibleExternalProviders.

public IEnumerable<ViewModel.ExternalProvider> VisibleExternalProviders => ExternalProviders.Where(x => !String.IsNullOrWhiteSpace(x.DisplayName));

https://github.com/DuendeSoftware/IdentityServer.Templates/blob/main/src/IdentityServerAspNetIdentity/Pages/Account/Login/ViewModel.cs#L12C1-L12C152

This results to the error message of Invalid login request being displayed in the UI.

https://github.com/DuendeSoftware/IdentityServer.Templates/blob/main/src/IdentityServerAspNetIdentity/Pages/Account/Login/Index.cshtml#L81

@damianh damianh transferred this issue from DuendeSoftware/IdentityServer.Templates Dec 21, 2024
@damianh damianh added the area/templates Related to Templates label Dec 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/templates Related to Templates
Projects
None yet
Development

No branches or pull requests

3 participants