dotnet / dotnet/aspnetcore

OpenIdConnect: setting the ClaimsIssuer property in configuration options has no effect

Open
#41,589 16 comments 0 reactions 0 assignees View on GitHub
area-auth blocked
Dominant language
C#
Stars
38.4k
Forks
10.9k
Avg merge
2d 5h
Merged PRs (30d)
276

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Describe the bug

When using the package Microsoft.AspNetCore.Authentication.OpenIdConnect in an ASP.NET Core application to add external login providers supporting OpenId Connect protocol, setting the `ClaimsIssuer` property in `OpenIdConnectOptions` has no effect; the principal claims still get generated with the issuer that comes from the external identity provider.

This behavior is in contrast with other social media login providers (Microsoft Account, Facebook, Google, etc.) where specifying this property in the configuration options would cause the principal claims to be issued with the specified claims issuer.

Is is possible to fix that so the `ClaimsIssuer` option in the OpenId Connect client works the same way it does in other social login provider packages? That way we can use it for any external identity provider that supports the OpenId Connect protocol but does not have a specific package built for it.

### Expected Behavior

Once the `ClaimsIssuer` property of the `OpenIdConnectOptions` is set, the principal claims should be issued with the specified claims issuer.

### Steps To Reproduce

1. Configure the OpenIdConnect client with any identity provider that supports OpenId Connect;
2. Set the `ClaimsIssuer` property to something different (e.g. "MyCustomIssuer") in `.AddOpenIdConnect()` configuration;
3. Verify that the actual issuer of the principal claims is unchanged.

### Exceptions (if any)

_No response_

### .NET Version

_No response_

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.