question

Jérémy avatar image
Jérémy asked

Is it possible to log a user from a CloudScript function ?

I'd like to avoid trusting the client by preventing it to use LoginWithCustomID(). But Playfab API doesn't provide a loginWith*() function for every provider. (namely Origin or GOG)

Here's what I'd like to do:

- Client call the third-party provider for a token
- Client send that token to a CloudScript function
- CloudScript function ask the third-party provider if the token is legitimate
- CloudScript function log the client
- CloudScript function return PlayfabId and Session ticket to the client
- Client call PlayfabSettings::staticPlayer->HandlePlayFabLogin() with the info

Problem: a CloudScript function requires a logged in user.

Is there a way around this issue or do I need to host my own webservice in place of the CloudScript function ?

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

·
Citrus Yan avatar image
Citrus Yan answered

All PlayFab Client APIs except the login ones require a authenticated user, therefore, a player must sign in first in order to execute a CloudScript function. And, since the Origin and the GOG login provider is not supported right now , so yes, in your case, a custom webservice would be a necessary part of your project.

BTW, you can also make a feature request about adding the Origin or GOG login provider here: https://community.playfab.com/spaces/24/index.html

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.

Jérémy avatar image Jérémy commented ·

Thanks, as the project is still in its early stage a feature request may effectively be useful.

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.