question

Kenneth Lightner avatar image
Kenneth Lightner asked

Is it possible to login with a CloudScript? I'm getting errors calling any CloudScript function before calling a login function.,Is it possible to call a Cloudscript before I call a login function? (i.e. to implement a custom login?)

CloudScript
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

Could you please clarify what the custom login function is like? Do you need to call the PlayFab Server APIs? Could you please provide more details about this question?

For clarification, we do not support anonymous calls to CloudScript. To call the CloudScript functions, the players must be logged into PlayFab first. If you want to do the custom verification before players registration, we suggest you host the logic on your own custom server. If there is no custom authentication server. You can consider using Azure Functions that support being called with HTTP methods. Please check the Azure Functions documentation - https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-http-webhook-trigger?tabs=csharp to learn about how to use HTTP request methods to invoke the Azure Functions.

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.

Kenneth Lightner avatar image Kenneth Lightner commented ·

@Sarah Zhang

Are you seriously suggesting I create my own server instead of using PlayFab?

So, what I'd like to do is support a different authentication provider - in this case, Oculus. It looks like all the hooks are there to run some CloudScript code to talk to Oculus to verify a user identity on the PlayFab server and then call the PlayFab server API to create a new identity. However, as you seem to have confirmed, I can't make this call anonymously, which means I have to create an unverified login first (PlayFabClientAPI.LoginWithCustomID()), and then call my CloudScript function to create the real, 3rd party verified identity. It seems awkward to me, as I'll be leaving a bunch of temporary users on the floor.

If this is the best way forward, then fine, but it seems worth asking if that was the plan?

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.