Browse Source

Add Lichess to the list of supported providers

pull/1807/head
Kévin Chalet 3 years ago
parent
commit
200ffc44d3
  1. 19
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs
  2. 18
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml

19
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs

@ -309,8 +309,8 @@ public static partial class OpenIddictClientWebIntegrationHandlers
{
ProviderTypes.Deezer or
ProviderTypes.Mixcloud => OpenIddictHelpers.AddQueryStringParameter(
uri: new Uri(context.TokenRequest.RedirectUri, UriKind.Absolute),
name: Parameters.State,
uri : new Uri(context.TokenRequest.RedirectUri, UriKind.Absolute),
name : Parameters.State,
value: context.StateToken).AbsoluteUri,
_ => context.TokenRequest.RedirectUri
@ -888,16 +888,15 @@ public static partial class OpenIddictClientWebIntegrationHandlers
// Note: this workaround only works for providers that allow dynamic
// redirection URIs and implement a relaxed validation policy logic.
(context.Request.RedirectUri, context.Request.State) = context.Registration.ProviderType switch
if (context.Registration.ProviderType is ProviderTypes.Deezer or ProviderTypes.Mixcloud)
{
ProviderTypes.Deezer or
ProviderTypes.Mixcloud => (OpenIddictHelpers.AddQueryStringParameter(
uri: new Uri(context.RedirectUri, UriKind.Absolute),
name: Parameters.State,
value: context.Request.State).AbsoluteUri, null),
context.Request.RedirectUri = OpenIddictHelpers.AddQueryStringParameter(
uri : new Uri(context.RedirectUri, UriKind.Absolute),
name : Parameters.State,
value: context.Request.State).AbsoluteUri;
_ => (context.Request.RedirectUri, context.Request.State)
};
context.Request.State = null;
}
return default;
}

18
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml

@ -457,6 +457,24 @@
Description="The URI used to access the Keycloak identity provider (including the realm, if applicable)" />
</Provider>
<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ████▄ ▄██ ▄▄▀██ ██ ██ ▄▄▄██ ▄▄▄ ██ ▄▄▄ ██
██ █████ ███ █████ ▄▄ ██ ▄▄▄██▄▄▄▀▀██▄▄▄▀▀██
██ ▀▀ █▀ ▀██ ▀▀▄██ ██ ██ ▀▀▀██ ▀▀▀ ██ ▀▀▀ ██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
-->
<Provider Name="Lichess" Id="320a2c10-d021-4488-a4dc-ade9e0a73072" Documentation="https://lichess.org/api#tag/OAuth">
<Environment Issuer="https://lichess.org/">
<Configuration AuthorizationEndpoint="https://lichess.org/oauth"
TokenEndpoint="https://lichess.org/api/token"
UserinfoEndpoint="https://lichess.org/api/account">
<CodeChallengeMethod Value="S256" />
</Configuration>
</Environment>
</Provider>
<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ████▄ ▄██ ▀██ ██ █▀▄██ ▄▄▄██ ▄▄▀█▄ ▄██ ▀██ ██

Loading…
Cancel
Save