Skip to content

Commit

Permalink
Add FACEIT to the list of supported providers
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinchalet committed Apr 25, 2024
1 parent 34db799 commit 3130108
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ public ValueTask HandleAsync(HandleConfigurationResponseContext context)
// types is amended to include the known supported types for the providers that require it.

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.RefreshToken);
Expand Down Expand Up @@ -183,7 +184,8 @@ public ValueTask HandleAsync(HandleConfigurationResponseContext context)
// are manually added to the list of supported code challenge methods by this handler.

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.Sha256);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -688,9 +688,10 @@ public ValueTask HandleAsync(ProcessAuthenticationContext context)
context.DisableBackchannelIdentityTokenNonceValidation = context.Registration.ProviderType switch
{
// These providers don't include the nonce in their identity tokens:
ProviderTypes.Asana or ProviderTypes.DocuSign or
ProviderTypes.Dropbox or ProviderTypes.LinkedIn or
ProviderTypes.QuickBooksOnline or ProviderTypes.WorldId => true,
ProviderTypes.Asana or ProviderTypes.DocuSign or
ProviderTypes.Dropbox or ProviderTypes.FaceIt or
ProviderTypes.LinkedIn or ProviderTypes.QuickBooksOnline or
ProviderTypes.WorldId => true,

_ => context.DisableBackchannelIdentityTokenNonceValidation
};
Expand Down Expand Up @@ -1604,6 +1605,13 @@ public ValueTask HandleAsync(ProcessChallengeContext context)
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"
// parameter to retrieve one (but it is only returned during the first authorization dance).
else if (context.Registration.ProviderType is ProviderTypes.Google)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,20 @@
</Setting>
</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>

<!--
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██ ▄▄▄█▄ ▄█▄▄ ▄▄██ ▄▄▀█▄ ▄█▄▄ ▄▄██
Expand Down

0 comments on commit 3130108

Please sign in to comment.