Closed gentledepp closed 1 month ago
So I switched tp "AddMicrosoft" as suggested,
.AddMicrosoft(options =>
{
options
.SetClientId("e622a0e5-f3e8-4998-b4e1-35f45e9b18cd") // application (client) id
.SetClientSecret("_8x8Q~fc7GxwbieK04mL2tQuzrlqMU_yPTd5rawD") // generated secret from azure portal
.SetRedirectUri("/callback/login/microsoft");
})
;
On AspNetCore, this works flawlessly. On AspNet (OpenIddict.Sandbox.AspNet.Server) though, I again get some weird URL displayed:
To fix this, I would have to do something like this:
Would that be correct?
It seems, though, that for Asp.Net there is
It seems, though, that for Asp.Net there is
It's actually by design: unlike ASP.NET Core Identity, ASP.NET Identity uses the Claim.Issuer
property of the name claim. Since both IdentityModel and OpenIddict use the issuer URI as the claims issuer, that's why you get a URI in the GUI.
That said, I agree it's not really a great UX so I went ahead and introduced a new claims issuer option that will ship in OpenIddict 6.0 RC2: https://github.com/openiddict/openiddict-core/pull/2209.
Personal contribution
Version
5.6.0
Provider name
AddActiveDirectoryFederationServices
Describe the bug
in Openiddict.Sandbox.AspNet.Server creates the following issues:
The login form does not show the ProviderDisplayName, but the ProviderName:
When login was successful but an account must be created, the form shows the login url instead of the ProviderDisplayName:
Note: I do not know where to get the
ProviderDisplayName
from, but at least one could use one of the two claims:E.g.:
Would return:
Can I improve this somehow?
To reproduce
Check out the branch https://github.com/gentledepp/openiddict-core/tree/issue/adfs Replace
with
... since github did not let me push secrets
Run the sample and login with the test user username
gadget@icltestportal.onmicrosoft.com
password:q328j+ye6;k"~*
Exceptions (if any)