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

Update LinkedIn issuer. #2162

Merged
merged 2 commits into from
Aug 15, 2024
Merged

Update LinkedIn issuer. #2162

merged 2 commits into from
Aug 15, 2024

Conversation

DovydasNavickas
Copy link
Contributor

It seems that LinkedIn has updated their issuer:
https://www.linkedin.com/oauth/.well-known/openid-configuration

And now LinkedIn provider gives an error:

fail: OpenIddict.Client.OpenIddictClientDispatcher[0]
      An error occurred while retrieving the configuration of the remote authorization server.
      System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'https://www.linkedin.com/oauth/.well-known/openid-configuration'. Will retry at '8/15/2024 4:57:15 PM +00:00'. Exception: 'OpenIddict.Abstractions.OpenIddictExceptions+ProtocolException: An error occurred while handling the configuration response.
        Error: server_error
        Error description: The issuer returned in the server configuration doesn't match the value set in the client registration options.
        Error URI: https://documentation.openiddict.com/errors/ID2165
         at OpenIddict.Client.OpenIddictClientService.<>c__DisplayClass19_0.<<GetConfigurationAsync>g__HandleConfigurationResponseAsync|3>d.MoveNext()
      --- End of stack trace from previous location ---
         at OpenIddict.Client.OpenIddictClientService.GetConfigurationAsync(OpenIddictClientRegistration registration, Uri uri, CancellationToken cancellationToken)
         at OpenIddict.Client.OpenIddictClientService.GetConfigurationAsync(OpenIddictClientRegistration registration, Uri uri, CancellationToken cancellationToken)
         at OpenIddict.Client.OpenIddictClientRetriever.Microsoft.IdentityModel.Protocols.IConfigurationRetriever<OpenIddict.Abstractions.OpenIddictConfiguration>.GetConfigurationAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)
         at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)'.
       ---> OpenIddict.Abstractions.OpenIddictExceptions+ProtocolException: An error occurred while handling the configuration response.
        Error: server_error
        Error description: The issuer returned in the server configuration doesn't match the value set in the client registration options.
        Error URI: https://documentation.openiddict.com/errors/ID2165
         at OpenIddict.Client.OpenIddictClientService.<>c__DisplayClass19_0.<<GetConfigurationAsync>g__HandleConfigurationResponseAsync|3>d.MoveNext()
      --- End of stack trace from previous location ---
         at OpenIddict.Client.OpenIddictClientService.GetConfigurationAsync(OpenIddictClientRegistration registration, Uri uri, CancellationToken cancellationToken)
         at OpenIddict.Client.OpenIddictClientService.GetConfigurationAsync(OpenIddictClientRegistration registration, Uri uri, CancellationToken cancellationToken)
         at OpenIddict.Client.OpenIddictClientRetriever.Microsoft.IdentityModel.Protocols.IConfigurationRetriever<OpenIddict.Abstractions.OpenIddictConfiguration>.GetConfigurationAsync(String address, IDocumentRetriever retriever, CancellationToken cancel)
         at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
         --- End of inner exception stack trace ---
         at Microsoft.IdentityModel.Protocols.ConfigurationManager`1.GetConfigurationAsync(CancellationToken cancel)
         at OpenIddict.Client.OpenIddictClientHandlers.ResolveClientRegistrationFromChallengeContext.HandleAsync(ProcessChallengeContext context)

The most important line is:

The issuer returned in the server configuration doesn't match the value set in the client registration options.

If I understand correctly, the only update needed is the Issuer in OpenIddictClientWebIntegrationProviders.xml.

Copy link
Member

@kevinchalet kevinchalet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR, @DovydasNavickas ❤️

@@ -1004,7 +1004,7 @@

<Provider Name="LinkedIn" Id="eb3bc226-ed25-4258-8a37-2bfcc4d628a2"
Documentation="https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin-v2">
<Environment Issuer="https://www.linkedin.com/"
<Environment Issuer="https://www.linkedin.com/oauth"
ConfigurationEndpoint="https://www.linkedin.com/oauth/.well-known/openid-configuration">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since LinkedIn now uses https://www.linkedin.com/oauth as the issuer, we can remove the ConfigurationEndpoint node 😃

@kevinchalet kevinchalet merged commit cd127b3 into openiddict:dev Aug 15, 2024
6 checks passed
@kevinchalet
Copy link
Member

Merged, thanks for your contribution, @DovydasNavickas!

I'll backport it to the 5.7 branch and release a 5.7.1 version later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants