Hi @Tiago C , you can accomplish this with custom policies in Azure AD B2C.
You'll need to register your application in the developer portals for Riot Games and Epic Games. Once you've done that, you'll get a Client ID, Client Secret, and the necessary endpoints for authorization and token.
Next, you'll create a metadata file for each provider. This file will include all the details like your Client ID, Client Secret, and the endpoints you got earlier. Here's an example:
<Metadata>
<Item Key="client_id">Your_Riot_Games_Client_ID</Item>
<Item Key="client_secret">Your_Riot_Games_Client_Secret</Item>
<Item Key="authorization_endpoint">https://auth.riotgames.com/authorize</Item>
<Item Key="token_endpoint">https://auth.riotgames.com/token</Item>
<Item Key="scope">openid profile email</Item>
</Metadata>
Then, you'll need to create custom policies. If you haven't already, you can grab a starter pack for custom policies from the Azure AD B2C GitHub repository. This pack includes base files like TrustFrameworkBase.xml
, TrustFrameworkExtensions.xml
, and SignUpOrSignIn.xml
.
In the TrustFrameworkExtensions.xml
file, you'll define a technical profile for each new IDP. Here’s an example of what you might add for Riot Games:
<TechnicalProfile Id="RiotGames-OAUTH">
<DisplayName>Riot Games</DisplayName>
<Protocol Name="OAuth2" />
<Metadata>
<Item Key="client_id">Your_Riot_Games_Client_ID</Item>
<Item Key="client_secret">Your_Riot_Games_Client_Secret</Item>
<Item Key="authorization_endpoint">https://auth.riotgames.com/authorize</Item>
<Item Key="token_endpoint">https://auth.riotgames.com/token</Item>
<Item Key="scope">openid profile email</Item>
</Metadata>
<InputClaims />
<OutputClaims>
<OutputClaim ClaimTypeReferenceId="issuerUserId" PartnerClaimType="sub"/>
<OutputClaim ClaimTypeReferenceId="displayName" PartnerClaimType="name"/>
<OutputClaim ClaimTypeReferenceId="email" PartnerClaimType="email"/>
</OutputClaims>
</TechnicalProfile>
After that, you’ll add a claims provider entry in the same TrustFrameworkExtensions.xml
file:
<ClaimsProvider>
<DisplayName>Riot Games</DisplayName>
<TechnicalProfiles>
<TechnicalProfile Id="RiotGames-OAUTH" />
</TechnicalProfiles>
</ClaimsProvider>
You'll also need to reference the new IDP in your SignUpOrSignIn.xml
file:
<ClaimsProviderSelections>
<ClaimsProviderSelection TargetClaimsExchangeId="RiotGamesExchange" />
</ClaimsProviderSelections>
<ClaimsExchanges>
<ClaimsExchange Id="RiotGamesExchange" TechnicalProfileReferenceId="RiotGames-OAUTH" />
</ClaimsExchanges>
Once you’ve got all that set up, deploy the custom policies through the Azure portal. Then, you can test the sign-in and sign-up processes to make sure users can authenticate using Riot Games and Epic Games.
If you need more detailed guidance, you can always check out the Azure AD B2C custom policy documentation and sample repositories on GitHub. They have some great examples to help you get started.
Please let me know if you have any questions and I can help you further. If this answer helps you please mark "Accept Answer" so other users can reference it. Thank you, James