question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issuer is overriden in validation

See original GitHub issue

Confirm you’ve already contributed to this project or that you sponsor it

  • I confirm I’m a sponsor or a contributor

Version

4.x

Describe the bug

At the moment I am not a contributor, because Paypal has been removed from Github and I am waiting for a new credit card (not that important in Germany to have one).

I hope it is okay to report the issue anyway. I will fix this on my side soon.

I have configured a custom Issuer URL that is configured on the server side and a call to ÙseLocalServer on the validation side. With the migration to 4.X this does not work anymore.

Basically my code looks like this:

services.Configure<OpenIddictServerOptions>((c, options) =>
{
   options.IssuerUrl = "...";
});
   
services.AddOpenIddict()
    .AddValidation(builder =>
    {
         builder.UseLocalServer();
    });

Here is what happens in my opinion. It took me a while to figure this out:

  1. UseLocalServer() registers an options configurator that copies the settings from the server:

https://github.com/openiddict/openiddict-core/blob/dev/src/OpenIddict.Validation.ServerIntegration/OpenIddictValidationServerIntegrationConfiguration.cs#L41

  1. After everything is copied the configuration validator kicks in and overrides the configuration issuer with the issuer from the options, which has never been configured:

https://github.com/openiddict/openiddict-core/blob/dev/src/OpenIddict.Validation/OpenIddictValidationConfiguration.cs#L96

I have added a custom configurator which issuer with the configuration issuer:

options.Issuer = options.Configuration.Issuer;

This solves the issue.

To reproduce

See above

Exceptions (if any)

No response

Issue Analytics

  • State:closed
  • Created 6 months ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
kevinchaletcommented, Mar 23, 2023

Do I get a fast hotfix? 😉

It will be part of the 4.2 release that will ship next week with tons of new web providers for the client stack and some interop improvements.

0reactions
kevinchaletcommented, Mar 24, 2023

@SebastianStehle I just merged the fix and it’s available in the 4.2.0-preview1.23174.52 nightly builds if you’re interested in giving a try 😃

Thanks again for sponsoring the project! ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can I disable issuer validation upon resource server startup?
JwtDecoders doesn't expose any properties that instructs it to not validate the issuer on startup (source file).
Read more >
Issuer validation problem · Issue #6028 · dotnet/aspnetcore
Is there a way to override thsi behavior? Add some custom issuer validatior or add "sts.windows.net" to the list of valid issuers?
Read more >
7 Common Reasons Why Issuer Declines Happen
Merchants might be able to respond to or override issuer declines in some cases. That doesn't mean you should always do so, though....
Read more >
Data Overrides - Examples and Validation Rules
For example, you can only override TotalSharesOutstanding with IssuerId/IssuerName. If you try to override TotalSharesOutstanding with ...
Read more >
Azure APIM Validate JWT policy is not evaluating token ...
Hi all, We have a multitenant AD app setup for issuing tokens to a cloud service we run. We want to do issuer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found