I am studying the docs for the REST API, but am struggling to find out how to accomplish something.
I'm looking to see how to call Cloud Code from the REST API. Is this possible?
What I'd like to do specifically is allow users to reset their password if they forgot it. So I'm following the Guide which shows how to email the user a link which contains the unique token ID.
I would like to create a web page which allows the user to enter a new password, which then calls the Cloud Code/RESTAPI which resets the password on the player object to the new value they selected.
Thank you for any help!
Drew
Best Answer
C
Customer Support
said
over 5 years ago
Hi Drew,
For a Password reset system like this I would recommend making use of Callbacks.
In this scenario, when you check an e-mail it will have a unique code embedded into it identifying that password reset request. When the user enters their new password and clicks submit on the web form, it would hit a callback url with the unique code (and any other information you would like to use to identify the player). The Cloud Code in this callback would then verify the unique code, the player, then load the player into a SparkPlayer object and change the password via setPassword.
For a Password reset system like this I would recommend making use of Callbacks.
In this scenario, when you check an e-mail it will have a unique code embedded into it identifying that password reset request. When the user enters their new password and clicks submit on the web form, it would hit a callback url with the unique code (and any other information you would like to use to identify the player). The Cloud Code in this callback would then verify the unique code, the player, then load the player into a SparkPlayer object and change the password via setPassword.
Does this seem like a good solution?
-Pádraig
1 person likes this
D
Drew Ferraro
said
over 5 years ago
Thanks Padraig, this was exactly what I was looking for!
I have another question - is there a way for me to validate an AuthToken given to me by GameSparks when I log the player in?
What I'd like to do is create a service outside of GameSparks which does certain things. But I want to integrate with GameSparks as well. In order for this to work, I need to be able to re-use the authentication scheme that GameSparks uses.
Is there some way to validate an AuthToken that GameSparks gives me from inside my app? (EG, a WebAPI call or SDK call?)
Is there some way to get the UserID and other user info about the user from a given Auth Token via A WebAPI or SDK call?
Drew Ferraro
hi,
I am studying the docs for the REST API, but am struggling to find out how to accomplish something.
I'm looking to see how to call Cloud Code from the REST API. Is this possible?
What I'd like to do specifically is allow users to reset their password if they forgot it. So I'm following the Guide which shows how to email the user a link which contains the unique token ID.
I would like to create a web page which allows the user to enter a new password, which then calls the Cloud Code/RESTAPI which resets the password on the player object to the new value they selected.
Thank you for any help!
Drew
Hi Drew,
For a Password reset system like this I would recommend making use of Callbacks.
In this scenario, when you check an e-mail it will have a unique code embedded into it identifying that password reset request. When the user enters their new password and clicks submit on the web form, it would hit a callback url with the unique code (and any other information you would like to use to identify the player). The Cloud Code in this callback would then verify the unique code, the player, then load the player into a SparkPlayer object and change the password via setPassword.
Does this seem like a good solution?
-Pádraig
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Drew,
For a Password reset system like this I would recommend making use of Callbacks.
In this scenario, when you check an e-mail it will have a unique code embedded into it identifying that password reset request. When the user enters their new password and clicks submit on the web form, it would hit a callback url with the unique code (and any other information you would like to use to identify the player). The Cloud Code in this callback would then verify the unique code, the player, then load the player into a SparkPlayer object and change the password via setPassword.
Does this seem like a good solution?
-Pádraig
1 person likes this
Drew Ferraro
Thanks Padraig, this was exactly what I was looking for!
I have another question - is there a way for me to validate an AuthToken given to me by GameSparks when I log the player in?
What I'd like to do is create a service outside of GameSparks which does certain things. But I want to integrate with GameSparks as well. In order for this to work, I need to be able to re-use the authentication scheme that GameSparks uses.
Is there some way to validate an AuthToken that GameSparks gives me from inside my app? (EG, a WebAPI call or SDK call?)
Is there some way to get the UserID and other user info about the user from a given Auth Token via A WebAPI or SDK call?
Thank you!
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics