-
Notifications
You must be signed in to change notification settings - Fork 217
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
There is no way to set the DisplayName for the OpenIdConnect provider #808
Comments
I'm happy to send a PR to add this |
The display name (of the signed-in user, I'm assuming) is inferred from the claims which are in the IDToken. There is no need to specify it externally. What is your scenario? what are you trying to do?. In which case would you want to override a display name which is not in the claims? To answer your question:
|
Hi there, what I am referring to by The code is what I mentioned above with this call |
Thanks for the update, @Shazwazza |
I have this problem as well, we cannot set the provider display name |
@Shazwazza @farshid3003 |
@jmprieur Since this lib can be used as boilerplate configuration for Azure B2C then the label could really be anything since B2C is a white label auth system that can be branded in any way. |
@jmprieur Just ran into this issue today. Having a default predefined name like "Microsoft Identity Platform" would be great to keep it unique compared to the basic OIDC provider. However, it is also beneficial to be able to change the name in cases where we might need to register mutliple instances of the Microsoft Identity provider as in the case of using something like Identity Server to provide a single federated auth system for a suite of applications. |
@jennyf19. I propose we take this one as well for next release. Spec.
Line 275 in 95d9696
string identityProviderDisplayName = "Microsoft identity platform" |
I would also ask that the implementation is consistent with the the built-in providers here: https://github.com/dotnet/aspnetcore/tree/2670c128d522473e146ff9f8159bfffdfe694cd9/src/Security/Authentication Namely, that the parameter name is |
@theyo : what is the rationale for this ask? the displayName makes sense for AddOpenIdConnect, but AddMicrosoftIdentityWebApp does way more than that. |
@jmprieur I don't think the comparison is between This method from Each of the other built-in ASP.NET providers (Google, Twitter, Facebook) expose |
there is a workaround you can use right now until the displayName parameter is more easily available: services.PostConfigure<AuthenticationOptions>(options =>
{
foreach (var scheme in options.Schemes)
{
if (scheme.Name == OpenIdConnectDefaults.AuthenticationScheme)
{
scheme.DisplayName = "My Desired Display Name";
}
}
}); or register the scheme with a different name: .AddMicrosoftIdentityWebApp(section, "MyCustomAuthScheme"); and replace the line in the first code snippet above with: if (scheme.Name == "MyCustomAuthScheme") |
@Tratcher FYI we still need to do that. |
I have a branch: https://github.com/AzureAD/microsoft-identity-web/tree/jennyf/displayName |
Included in 1.16 release |
Which version of Microsoft Identity Web are you using?
1.3.0
Where is the issue?
It's not possible to set the display name since the call to AddOpenIdConnect is all done internally here
microsoft-identity-web/src/Microsoft.Identity.Web/WebAppExtensions/MicrosoftIdentityWebAppAuthenticationBuilderExtensions.cs
Line 254 in c75ea22
Is this a new or an existing app?
c. This is a new app or an experiment.
Expected behavior
There should be a parameter in
AddMicrosoftIdentityWebApp
to supply a DisplayNameActual behavior
There is not an option to do this
The text was updated successfully, but these errors were encountered: