Browse Source

Add FACEIT to the list of supported providers

pull/2058/head
Kévin Chalet 2 years ago
parent
commit
3130108fc7
  1. 6
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs
  2. 14
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.cs
  3. 14
      src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationProviders.xml

6
src/OpenIddict.Client.WebIntegration/OpenIddictClientWebIntegrationHandlers.Discovery.cs

@ -108,7 +108,8 @@ public static partial class OpenIddictClientWebIntegrationHandlers
// types is amended to include the known supported types for the providers that require it. // types is amended to include the known supported types for the providers that require it.
if (context.Registration.ProviderType is if (context.Registration.ProviderType is
ProviderTypes.Apple or ProviderTypes.LinkedIn or ProviderTypes.QuickBooksOnline) ProviderTypes.Apple or ProviderTypes.FaceIt or
ProviderTypes.LinkedIn or ProviderTypes.QuickBooksOnline)
{ {
context.Configuration.GrantTypesSupported.Add(GrantTypes.AuthorizationCode); context.Configuration.GrantTypesSupported.Add(GrantTypes.AuthorizationCode);
context.Configuration.GrantTypesSupported.Add(GrantTypes.RefreshToken); context.Configuration.GrantTypesSupported.Add(GrantTypes.RefreshToken);
@ -183,7 +184,8 @@ public static partial class OpenIddictClientWebIntegrationHandlers
// are manually added to the list of supported code challenge methods by this handler. // are manually added to the list of supported code challenge methods by this handler.
if (context.Registration.ProviderType is if (context.Registration.ProviderType is
ProviderTypes.Adobe or ProviderTypes.Autodesk or ProviderTypes.Microsoft) ProviderTypes.Adobe or ProviderTypes.Autodesk or
ProviderTypes.FaceIt or ProviderTypes.Microsoft)
{ {
context.Configuration.CodeChallengeMethodsSupported.Add(CodeChallengeMethods.Plain); context.Configuration.CodeChallengeMethodsSupported.Add(CodeChallengeMethods.Plain);
context.Configuration.CodeChallengeMethodsSupported.Add(CodeChallengeMethods.Sha256); context.Configuration.CodeChallengeMethodsSupported.Add(CodeChallengeMethods.Sha256);

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

@ -688,9 +688,10 @@ public static partial class OpenIddictClientWebIntegrationHandlers
context.DisableBackchannelIdentityTokenNonceValidation = context.Registration.ProviderType switch context.DisableBackchannelIdentityTokenNonceValidation = context.Registration.ProviderType switch
{ {
// These providers don't include the nonce in their identity tokens: // These providers don't include the nonce in their identity tokens:
ProviderTypes.Asana or ProviderTypes.DocuSign or ProviderTypes.Asana or ProviderTypes.DocuSign or
ProviderTypes.Dropbox or ProviderTypes.LinkedIn or ProviderTypes.Dropbox or ProviderTypes.FaceIt or
ProviderTypes.QuickBooksOnline or ProviderTypes.WorldId => true, ProviderTypes.LinkedIn or ProviderTypes.QuickBooksOnline or
ProviderTypes.WorldId => true,
_ => context.DisableBackchannelIdentityTokenNonceValidation _ => context.DisableBackchannelIdentityTokenNonceValidation
}; };
@ -1604,6 +1605,13 @@ public static partial class OpenIddictClientWebIntegrationHandlers
context.Request.Prompt = settings.Prompt; context.Request.Prompt = settings.Prompt;
} }
// FaceIt requires sending a custom "redirect_popup" parameter
// with the value "true" for the login flow to work correctly.
else if (context.Registration.ProviderType is ProviderTypes.FaceIt)
{
context.Request["redirect_popup"] = true;
}
// By default, Google doesn't return a refresh token but allows sending an "access_type" // By default, Google doesn't return a refresh token but allows sending an "access_type"
// parameter to retrieve one (but it is only returned during the first authorization dance). // parameter to retrieve one (but it is only returned during the first authorization dance).
else if (context.Registration.ProviderType is ProviderTypes.Google) else if (context.Registration.ProviderType is ProviderTypes.Google)

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

@ -599,6 +599,20 @@
</Setting> </Setting>
</Provider> </Provider>
<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ▄▄▄█ ▄▄▀██ ▄▄▀██ ▄▄▄█▄ ▄█▄▄ ▄▄██
██ ▄▄██ ▀▀ ██ █████ ▄▄▄██ ████ ████
██ ████ ██ ██ ▀▀▄██ ▀▀▀█▀ ▀███ ████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
-->
<Provider Name="FaceIt" DisplayName="FACEIT" Id="6523733a-b217-4ad6-afcf-67f320db910f"
Documentation="https://developers.faceit.com/docs/auth/oauth2">
<Environment Issuer="https://api.faceit.com/auth"
ConfigurationEndpoint="https://api.faceit.com/auth/v1/openid_configuration" />
</Provider>
<!-- <!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ▄▄▄█▄ ▄█▄▄ ▄▄██ ▄▄▀█▄ ▄█▄▄ ▄▄██ ██ ▄▄▄█▄ ▄█▄▄ ▄▄██ ▄▄▀█▄ ▄█▄▄ ▄▄██

Loading…
Cancel
Save