question

Choi Yan Lok avatar image
Choi Yan Lok asked

Custom Login and Payment Verification

We are working with a publisher, and we need to implement their authentication system and payment verification callback.

We would like to see if it is possible for us to implement these features directly with PlayFab without needing to have our own intermediate server to communicate between the publisher's server and PlayFab.


Details:
1. Authentication System

- Client will use the Publisher SDK to log in, On success, it will return a publisher_access_token

- Client should then use the publisher_access_token to login to PlayFab, and on PlayFab side, it should call the publisher's REST API to obtain the publisher_user_id from the publisher_access_token, and then register/login to PlayFab with publisher_user_id

- Is there any way for us to implement the above feature directly with PlayFab? If not, what's the best way to implement it with our intermediate server?


2. Payment Verification Callback

- Client will use the Publisher SDK to initialize IAP, on IAP success, publisher's server will send a POST request to our custom server, or PlayFab (if possible)

- The POST request contains the order_id, product_id, signature, timestamp, etc.

- We should check if the order_id has been processed, and verify the purchase based on the signature and a private AppKey

- We grant the player the item if verification success and return "success" for the post request\


thank you

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

·
Rick Chen avatar image
Rick Chen answered

For authentication system, PlayFab only supports these platforms, for other Platform or Publisher, an intermediate server is required.

For payment verification callback, you could use the Azure Function to process verification and grant player the item. Azure Functions allows you to implement your system's logic into readily available blocks of code. Please refer to: https://docs.microsoft.com/en-gb/gaming/playfab/features/automation/cloudscript-af/quickstart

3 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.

Choi Yan Lok avatar image Choi Yan Lok commented ·

Thanks for your suggestions! It seems like azure function could solve both of our problems.

However, we are having some trouble with the custom authentication. Is there any PlayFab Admin API that can create a session ticket for a custom id?

I was thinking of creating an azure function that takes our publisher's access token, and return a playfab session ticket. However, I can't find any admin API that can create session ticket for a custom ID. There's a client API (LoginWithCustomID), but it will get rate-limited and we couldn't use it.

Thanks

EDIT: Server/LoginWithServerCustomId should do the job

0 Likes 0 ·
Choi Yan Lok avatar image Choi Yan Lok commented ·

It seems like we also lack an admin API that allows us to obtain the playfabId from customId. (GetUserAccountInfo doesn't support playfab id)

Since the process purchase azure function is trigger through our publisher's webhook, not playfab directly, we couldn't obtain the playfab id...

Did I miss anything?

EDIT: Server/LoginWithServerCustomId should do the job

0 Likes 0 ·
Rick Chen avatar image Rick Chen ♦ Choi Yan Lok commented ·

Indeed, there is no admin API to retrieve playfabId from customId. Yes, the LoginWithServerCustomId API should do the trick. Glad that you figure it out.

0 Likes 0 ·

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.