question

Greggory Addison avatar image
Greggory Addison asked

How to go about Using Epic Online Services as Open ID

Currently I have set up an open Id connection using Epic Online Services. Either I don’t have it set up properly or I’m missing something g crucial. Right how I’m getting this error when trying to call the “LoginWithOpenId” Api call in the playfab sdk


Error: IDX10501: Signature validation failed. Unable to match key: 
kid: '2022-06-14T06:17:57.047928700Z'.
apissdksunrealAuthenticationmultiplayer
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Greggory Addison avatar image
Greggory Addison answered

So the answer to this is pretty straight forward. Most docs use GetAuthToken() function to retrieve the JWT and pass it to the API call in playfab but the code you really need is this

const IOnlineIdentityPtr IdentityInterface = OnlineSubsystem->GetIdentityInterface();
FString Token;
IdentityInterface->GetUserAccount(UserId)->GetAuthAttribute("epic.idToken", Token);
PlayFab::ClientModels::FLoginWithOpenIdConnectRequest EOSLoginRequest;
EOSLoginRequest.TitleId = "YOUR_APP_ID";
EOSLoginRequest.ConnectionId = "EOS"; // Made in the PlayFab Game Manager
EOSLoginRequest.IdToken = Token;
EOSLoginRequest.CreateAccount = true;

ClientAPI->LoginWithOpenIdConnect(EOSLoginRequest,
   PlayFab::UPlayFabClientAPI::FLoginWithOpenIdConnectDelegate::CreateUObject(this, &ThisClass::OnSuccess),
   PlayFab::FPlayFabErrorDelegate::CreateUObject(this, &ThisClass::OnError));
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

giovannifrigo avatar image giovannifrigo commented ·

This is working for me, thanks!

0 Likes 0 ·
Gosen Gao avatar image
Gosen Gao answered

To use OpenID login, you need to set up an application in the OpenID provider’s backend and gather the ‘ClientId’, ‘ClientSecret’ and ‘IssuerDiscoveryUrl’ to call Authentication - Create OpenId Connection - REST API (PlayFab Admin) | Microsoft Learn. And then you can get the ID token from the OpenID provider to call Authentication - Login With OpenId Connect - REST API (PlayFab Client) | Microsoft Learn. You may check your current workflow and make sure it sets up properly.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.