question

Patryk Szylin avatar image
Patryk Szylin asked

Account linking Playfab to Cognito

I'm currently developing and app and a game side-by-side but want to keep the user database of both separate but allow account linking between the two. Currently the app is using Cognito and the game is using Playfab, is there any way that I can account link users between the two?

I've had a look around but can only seem to find adding cognito as a provider to playfab, but I need to be able to do it vice versa too, is this possible?

Authentication
10 |1200

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

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

Playfab API LoginWithOpenIdConnect supports logging in a user with an Open ID Connect JWT created by an existing relationship between a title and an Open ID Connect provider. You can navigate to this page(https://developer.playfab.com/en-US/r/t/[YourTitleId]/settings/connections/new) or use API CreateOpenIdConnection to Registers a relationship between a title and an Open ID Connect provider. If AWS Cognito can be used as an OpenId connection provider, it’s possible to link Playfab accounts to Cognito. It’s the possible way to link Cognito accounts to PlayFab.

About the reverse approach, PlayFab currently cannot be used as an OpenId connection or other authentication Identity provider. You may need to search for the corresponding documentation of Cognito for other possibilities. If you make any progress or have other technical supports from PlayFab side, welcome to discuss it with us.

4 comments
10 |1200

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

Patryk Szylin avatar image Patryk Szylin commented ·

I thought it was the case that Playfab couldn't be used as a provider, just wanted to verify that assumption.

I have started to create a bit of middleware which will sit between Cognito and Playfab and plan to use the API in order to account link the two; do you think this a viable method?

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Patryk Szylin commented ·

I think it would be viable. Playfab client login API is not recommended to call frequently in the same IP. But the session ticket returned from Playfab login API can be used as the login credentials to some extent. A session ticket will be expired after 24 hours and it can be validated by Server API AuthenticateSessionTicket. Security in transferring and storing credentials should be considered too. Besides, it also depends on how much Cognito can support.

1 Like 1 ·
Patryk Szylin avatar image Patryk Szylin Sarah Zhang commented ·

It's taken a while, but I think I have finally made a viable solution to the problem. I have created an OpenID Connect provider to act as a middleware of sorts between Playfab and Cognito. It works by authenticating the user using the aforementioned Login API and then subsequent calls for user info use the GetPlayerCombinedInfo endpoint.

0 Likes 0 ·
Show more comments

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.