Microsoft Entra Ad B2C, Epic Games and Riot games as IDP

Tiago C 20 Reputation points
2024-11-27T14:44:39.23+00:00

Following the the examples of the IDPs in this list https://learn.microsoft.com/en-us/azure/active-directory-b2c/add-identity-provider, I have setup 4 different IDPs with custom policies.
Currently I am looking into setting up Riot Games and Epic Games, I noticed there is no official documentation on it.
Is there documentation on how to do the claim provider setup for IDPs that are not in the list ?

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
24,244 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. James Hamil 27,191 Reputation points Microsoft Employee
    2024-11-27T20:51:05.8433333+00:00

    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


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.