How can I reset achievements from Google Game Services? - google-play-services

I'm testing my game using Google's new Games Services, and I'd like to reset my account's achievements for testing.
I've found that you can reset achievements using google's APIs (https://developers.google.com/games/services/management/api/#Achievements) and I'm using the OAuth 2.0 playground to send the POST request, but it's not working :(
Specifically, I'm a sending POST request for "https://www.googleapis.com/games/v1management/achievements/reset" as detailed in that link.
AND, when I go to code.google com and check my Services, all the Play services are "ON".
Here is the output. How can I reset my achievements for testing? Am I even close? Apparently my "access is not configured" How do I do that? What was the point of the whole first 2 steps of the OAuth2.0 playground if not to grant my access?
HTTP/1.1 403 Forbidden
Content-length: 205
X-xss-protection: 1; mode=block
X-content-type-options: nosniff
X-google-cache-control: remote-fetch
-content-encoding: gzip
Server: GSE
Reason: Forbidden
Via: HTTP/1.1 GWA
Cache-control: private, max-age=0
Date: Sun, 19 May 2013 04:11:38 GMT
X-frame-options: SAMEORIGIN
Content-type: application/json; charset=UTF-8
Expires: Sun, 19 May 2013 04:11:38 GMT
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured"
}
],
"code": 403,
"message": "Access Not Configured"
}
}

This is how I got it to work:
Open the Google Play Developer Console, go to Linked Apps under Game Services and click Link another App -> Web, for the URL use https://developers.google.com/oauthplayground and complete the setup of this linked app. Make sure the same URL is listed as an authorized redirect URI.
Go to https://developers.google.com/oauthplayground and click on the gears icon in top right, select Use your own OAuth credentials, and copy the Client ID and Client secret for your Web app from https://code.google.com/apis/console.
For the Scope in OAuth Playground's Step 1 use https://www.googleapis.com/auth/games, which is found under Google Play Game Services API.
Do a POST to https://www.googleapis.com/games/v1management/achievements/reset or https://www.googleapis.com/games/v1management/achievements/resetAllForAllPlayers or whatever, leave all other options as is.
Profit :)
Note:
At first I was doing step 2. after step 3. and it gave me the 403

You must set your Client ID & Client Secret in Google Playground.
Click to right side of top "Setting Button". Set your credential information to there.
Finally click to first tab from left side of page. Select scopes and Authorize!

I couldn't get the POST request to work either, but you can reset your achievements by deleting and re-adding your tester account.

There's now a Reset button for draft Achievements and Leaderboards in the bottom of each entry.

Check out this tool which google has provided in their GitHub Repo
https://github.com/playgameservices/management-tools/tree/master/demo-management-tools
Using the tool you can manage Google Play Games Management API to manage and test Google Play Games Features which includes resetting of the Achievements and Leaderboard.

As WeirdElfBOy said, there is a reset button inside every achievement in your developer console. But the following requirements must be fulfilled to get the reset work:
it has to be a release signed apk which is installed for testing.
The app must be in alpha or beta test phase, using the same version of app that you have installed for testing (not rellay sure about that)
The Play Games settings for your app shouldn´t be published. You can only reset achievements for test users with an unpublished game. With game I mean the play games settings, not the app itself.
After pressing the reset, it needs long time to reset, in my test it needed about 1 hour, but maybe could be longer or shorter.
So for reset an achievement, you don´t need to use ManagementAPI.
But there is a little issue, I think it´s on Googles site and I reported it to Google. The reset doesn´t work on incremental achievements.

Open the Google Play Games app on your phone, go to settings, and then select "Delete Play Games data", scroll down, and delete data from your game.

Related

idpiframe_initialization_failed with People Api

I am testing out the People Api, i started with the Browser quick start from google
I have followed all the instructions shown on the quick start.
I also added my localhost url to Authorized origins section on google developer console. I made sure i have the correct api key and client ID.
When i access the app's url http://0.0.0.0:8081/ , the page sends back below error
People API Quickstart
{
"error": "idpiframe_initialization_failed",
"details": "Not a valid origin for the client: http://0.0.0.0:8000 has not been whitelisted for client ID 555307262665-8a97q8pl4etkjh98nvsqnn9hu9ah68bv.apps.googleusercontent.com. Please go to https://console.developers.google.com/ and whitelist this origin for your project's client ID."
}
I've read online about the issue and most people seemed to have sorted the issue by clearing browser cache.
I've cleared browser cache and enabled see cookies and site data for
accounts.google.com on the browser, but that doesn't seem to help, i still get the error.
Is there anything am missing ?

How can I get PLAIN authentication working with Google's IMAP server?

So for a while I've been relying on the PLAIN support for logging into Google's IMAP server in my email client. Recently they started blocking that and return an error (despite listing it as a supported authentication method).
For instance take this example:
Connected to 'imap.gmail.com:993' using SSL
A0001 CAPABILITY
* OK Gimap ready for requests from ##.##.##.## cd6mb38777249ieb
* CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH2 AUTH=PLAIN AUTH=PLAIN-CLIENTTOKEN AUTH=XOAUTH
A0001 OK Thats all she wrote! cd6mb38777249ieb
A0002 AUTHENTICATE PLAIN
+
####################################
* NO [WEBALERT https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbszktZSU6iVmh...snip....] Web login required.
A0002 NO [ALERT] Please log in via your web browser: http://support.google.com/mail/accounts/bin/answer.py?answer=78754 (Failure)
SSL connection closed.
ScribeImap_Thread.cpp:647 - Connect to imap.gmail.com:993 failed.
I've tried opening the "https://accounts.google.com/ContinueSignIn..." URL in my browser:
And I get redirected to https://myaccount.google.com/ but the next login attempt fails as well. So it doesn't seem to change the authentication at all.
Is the PLAIN authentication just blocked completely or am I doing it wrong?
Alternatively is there a authentication method that works and DOESN'T need a browser component to log in? (XOAUTH2 seems to need a web login as well)
It's pretty official:
http://googledevelopers.blogspot.com.au/2015/04/a-final-farewell-to-clientlogin-oauth.html
They have shut off PLAIN login completely and it's not coming back.
So there are two options:
Turn on "less secure apps".
Implement OAUTH2.
I've decided to implement OAUTH2 support (which isn't too far off working actually). Initially I thought I would need an embedded browser component in my app, but it turns out that I can launch the system browser and the user can copy the token across in a some what manual process.
Interestingly for those working on OAUTH2 support in their software, Google have setup a playground to see the whole process in practice:
https://developers.google.com/oauthplayground/
I see that this is an old post, but after fighting with Outlook for over a year to get my mail, I FINALLY got it working again.
The first thing I had to do was log into my my Gmail account and turn off the button labeled "Less secure apps" as Outlook is in that category.
Go to the "Less secure apps" section in My Account.
Next to "Access for less secure apps," selectTurn on. (Note to Google Apps users: This setting is hidden if your administrator has locked less secure app account access.)
And if you have 2-step verification on (as I did), it will still make Outlook fail. So the next thing you have to do is create an app password which will generate a password for you, and you use that in Outlook for it to sync correctly.
Visit your App password page. You may be asked to sign in to your Google Account.
At the bottom, click Select app and choose the app you’re using.
Click Select device and choose the device you’re using.
Since Outlook will not be listed, select Other and type in Outlook for future reference.
Select Generate.
Follow the instructions to enter the App password (the 16 character code in the yellow bar) on your device.
Select Done.
Copy the password that was generated.
Open Outlook and paste the password in the Password section. DO NOT use your regular password.
Your mail will sync without anymore issues. (Hopefully)
Once you are finished, you won’t see that App password code again. However, you will see a list of apps and devices you’ve created App passwords for.
I hope this helps everyone who is having an issue. And I hope these directions are easy to follow! Good luck everyone! :-)

Google OAuth1 to OAuth2 migration - displays consent screen again

I followed OAuth1 to OAuth2 migration documentation and was able to get new refresh_token and access_tokens.
The issue is, Google displays approval screen again and list all the scopes. The whole point of migrating the credentials is that user should not see the approval screen.
Here is my POST request for migration:
POST https://accounts.google.com/o/oauth2/token HTTP/1.1
Authorization: OAuth realm="",oauth_consumer_key=[CONSUMER
KEY]",oauth_nonce="2c06a5da90ec4a62b737bdfb3922d675",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1411677478",oauth_token="[OAUTH
TOKEN]",oauth_signature="oL%2b2JdOBCKcND8cSHSmHQMRN5NI%3d"
Content-Type: application/x-www-form-urlencoded Host:
accounts.google.com Content-Length: 194 Expect: 100-continue
Connection: Keep-Alive
grant_type=urn%3aietf%3aparams%3aoauth%3agrant-type%3amigration%3aoauth1&client_id=&client_secret=[GENERATED
SIGNATURE]
Further more, if I check https://security.google.com/settings/security/permissions?pli=1 page to see which application I have given access to, I see my new application there, with all the scopes that older application had.
I also made sure that I don't include approval_prompt=force
Any thoughts? Am I wrong in assuming that the user will not see the approval screen after migration?
You're right, the point of migrating the credentials is that the user should not see the approval screen. But if you added any new scopes, maybe to use some APIs, most of them require the user to grant permission and therefore a approval screen will be displayed again.
Can you clarify the steps and when does a user see the approval page? What scopes do your OAuth2 tokens have after the migration?
The migration is for a OAuth1 token that you have stored on your backend. With migration step you convert these to OAuth2 refresh token. You can start using these to make calls to Google APIs without a user showing up on your site.
Depending on how you got these OAuth1 tokens, you need to change that mechanism to start getting OAuth2 tokens. In general you want to do this only for the users you don't have a refresh token already stored as there is no point getting a new refresh token (if you do, they may see an approval screen).

Error code 403 in Google+ api

I got "error": {
"errors": [
{
"domain": "usageLimits",
"reason": "dailyLimitExceededUnreg",
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.",
"extendedHelp": "https://code.google.com/apis/console"
}
],
"code": 403,
"message": "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup."
}
When i try to fetch User Profile in Google+ api by https://www.googleapis.com/plus/v1/people/me URL String.If anyone have any suggestion then please tell me as soon as possible.Thanks in advance for your time.
That message implies that you haven't set up a Google APIs console project.
Create a Google APIs Console project
On the Services pane, enable all of the APIs that your project requires.
On the API Access pane, click Create an OAuth 2.0 client ID. A dialog opens. Fill in your project's information. Click Next
Choose the appropriate application type. Based on the tags you used for this post, I am guessing this is an iOS project so select Installed application.
Enter your bundle ID. You don't need to enter an App Store ID until your app is listed there.
Click Create Client ID.
You will see the client ID and client secret values. You will use these values to enable communication with your project and the Google APIs.
If you aren't already using it, see the Google+ iOS SDK and documentation for a full walk through. The task called "write moments" is similar in implementation and demonstrates how to connect to and use the Google+ REST APIs from within an iOS project that uses the SDK.
You'll need to specify the scope of plus.me to get the profile information.
I got the same error and after much hunting I found that, in my case, the Authorization header with the access token was not set. Set Authorization: "Bearer <YOUR_ACCESS_TOKEN>" in the header of the request of EVERY Google API call.
I just want to add a little information here in the rare case that someone runs into this problem.
I have an organization (ORG). I created a second channel (SC) with some playlists, that referenced videos from ORG.
I made the mistake of assuming that because ORG owned SC, that I could use the same oauth credentials from ORG to access both. I was wrong.
I switched credentials and was confused when I could access the playlists but not the videos. Again, I needed credentials for each one separately to access the resources on the respective channel.
Lame, but that was how it was.
BrettJ's answer will cover most of the bases. However, you will also get this error - even when your credentials are properly authenticated - when the scope is not properly set up. I would check the scope setting in your OAuth dance. Make sure your user is permitted to do the thing your code is trying to help them do.
On top of what BrettJ has mentioned, it is important to send the authorization header for the request done to fetch UserProfile in google+ API.
For example, Add the following header
key: Authorization
value: Bearer ya29.Ci-cA_CywoVdVG#######
For what it's worth, I also got this error when using rclone to sync files and my firewall wasn't configured to allow that traffic.

Access tokens expire after only 1 day

With my Flattr client using the REST API, it seems that access tokens expire after 1 day. I checked my settings and the client is still authenticated. But when I issue a request to https://api.flattr.com/rest/v2/user I get the following response:
{
"error":"unauthorized",
"error_description":"You are unauthorized to access the resource",
"error_uri":"http:\/\/developers.flattr.net\/api"
}
I think I now know what the problem is. I am logging into Flattr with an iPhone and with the iPhone Simulator using the same account. It seems that using the API with more than one device will cause the user to need to login every time he changes devices.
I guess support for more than one access token at the same time is needed. Please confirm.