Twitter digits-android: exception 403 error:239 - android

I'm trying to implement the sample Twitter Digit app available on Github.
https://github.com/twitter/digits-android
But after following all the steps and populating every known place with API key and API secret.
My code is same I've just populated the properties file.
I'm getting: Digits﹕ HTTP Error: 403 Forbidden, API Error: 239, User Message: Try Again
Can anyone tell where the mistake is ?

The project will not work when copied as-is. You need to replace the consumer key and secret provided in the example project with your own. You can generate your own consumer key and secret via Fabric web portal.
#stack5: I have written this answer after reading the comments. I found that you've already received your answer. I'm writing this here so that anybody else facing similar issue would get benefited. Please accept this answer for the community.

Related

GCM Server API Key Unauthorized (401)

The GCM API has suddenly started throwing an Unauthorized (401) error. A lot of answers suggest using Server key instead of an Android key, but we are already doing that.
Also the Allowed IPs field is left blank. The key was working until a couple of days ago it suddenly started throwing a 401 error.
We have also tried regenerating a new key, but it still throws a 401. Any help would be greatly appreciated.
Found a related thread to your issue. Maybe you had the server key configured in your Android project and was creating new Sender(SERVER_KEY) with it. Clearly the server key must be configured in the appengine project (with GCM messaging enabled). Otherwise it may still work, however there must be different quotas or something, which causes 401 after several days of using.
You can also try the answer here that suggests to whitelist the IPv6 address. If you want only IPV4, add this to your curl php init: curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );.
Check these related links:
GCM http 401 authorization error
GCM HTTP Error 401: Unauthorized
Hope this helps!

getting Google oauth authorization token from Android- return with invalid_scope/ Unknown error

I try to use Google oauth to authenticate users on my android app.
Then I would like to send it to my app server so it can connect at any time with Google calendar.
I tried to use
GoogleAuthUtil.getToken(getApplicationContext(), mAccountName, mScope);
Following this article:
https://developers.google.com/accounts/docs/CrossClientAuth
When I use it with scope
mScope = "oauth2:https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile";
I get a token, which is valid for an hour
But when I try to get an authorization code (so I can get a refresh token that is valid for longer time, using
mScope2 ="oauth2:server:client_id:{CLIENT_ID}.apps.googleusercontent.com"+ ":api_scope:https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile";
I receive either "invalid_scope" or "Unknown" exceptions.
What am I doing wrong?
EDIT:
OK, After creating a new app on google API console and adding plus.login to the scope I get a code, but for some reason my server can't resolve this token. When tying to resolve server gets an error about the redirection URL.
BTW, When I do the web flow with same parameters it works.
OK, found the solution, I expected Google to have a lot better documentation about working with Google Oauth and Android. A few things you have to know to work with Android and offline token
When you create google Client ID Don't create a service application before you create a web application
Must include https://www.googleapis.com/auth/plus.login in your scope
The weirdest, to resolve the one time authorization code on my server, I had to use the redirection URL from the Android client ID details (which doesn't even look like a url) and not from the Web client details on Google API console.
That scope string is only documented to work when passed to GoogleAuthUtil(), see http://developer.android.com/reference/com/google/android/gms/auth/GoogleAuthUtil.html, on Android. But it would be cool if it worked on iOS too; our infrastructure there is a little behind where we’re at on Android.
I have had the same issue then i realised that my app is not published and is in debug mode, so i had to add test users to the Google project -> Consent Screen, then i was able to fetch the token for the added test user.
You just need to follow the correct steps/format for specifying the scopes. Find them here https://developers.google.com/android/guides/http-auth#SpecifyingScopes

getting access token for Youtube

I have generated the Client ID, Client Secret, redirect-url and code by the help of this API Documentation.
https://developers.google.com/youtube/2.0/developers_guide_protocol_oauth2#OAuth2_Installed_Applications_Flow
I am doing same as above Document, but gives the following error.
Error: invalid_request
Required parameter is missing: response_type
Currently for the version 3, the implementation is quite easy. Have a look at the Google Task sample.

OAuthNotAuthorizedException, When twitter is run in android application

I am working on an application in which I had to make a new project from existing code. The parent project contains Twitter support classes and Twitter is working fine in that application. But in the newly created project, the Twitter throws following error:
oauth.signpost.exception.OAuthNotAuthorizedException: Authorization failed (server replied
with a 401). This can happen if the consumer key was not correct or the signatures did not
match.
This is quite strange for me. Twitter does not work. However if i run the old snippet it works...Why not on the new one? when there is no difference between the Twitter implementation in the both projects. I have verified date/time on the devices..but that is not issue. Any help please..???
With what you have posted it is nearly impossible to help you. i can just provide some help:
First check the keys (secret and id) you got from twitter.
Check your permissions (probably have this right since it is a response from twitter)
Then check if your Auth process is going ok. that is if the Request is signed right,
then check the auth callback, if it was processed correctly (how does your implementation return the oauth token?).

Google places autocomplete api - REQUEST_DENIED

I'm creating app that use autocomplete places google api.
And I don't know what is wrong but all the time I got responses like:
{
"predictions" : [],
"status" : "REQUEST_DENIED"
}
I send req : https://maps.googleapis.com/maps/api/place/autocomplete/json?input=Paris&types=geocode&language=fr&sensor=true&key=mykey
Documentation says :
REQUEST_DENIED indicates that your request was denied, generally because of lack of a sensor parameter.
I have sensor parameter, maybe it is something with api key.
Is there any page where can I get google's log :), to see why I got REQUEST_DENIED?
I use api key from :
http://code.google.com/intl/pl-PL/android/maps-api-signup.html
Maybe I have to get an api key from somewhere else.
You should be able to view your API Key by going to the API Console first:
https://code.google.com/apis/console
If you haven't yet, you will need to create a new "Project" and then enable the Predictions services first by using the On/Off switch.
Please post your results, I have a similar problem with getting the REQUEST_DENIED response, but I've already got the API key and I'm using the sensor parameter like their documentation states.
It is frustrating that Google doesn't give any sort of response code along with REQUEST_DENIED so you can see why it's denying it. This will be difficult to support and troubleshoot in a production environment if this randomly goes out without providing any details as to why.
Update:
I just found this works for me now, but only after changing my requests to GET requests instead of POST. For reasons unknown, Google returns REQUEST_DENIED for POST requests but allows the same request via GET. A quick test for you to see if this is your problem would be to put the URL together with your API key and other parameters and try it through your browser instead. If that works then just rewrite your Android code to use GET instead of POST and you should be all set.
It was solved for me when I exchanged the API key. I was using the one under Android device, I changed it to the one "Key for browser apps (with referers)" and it worked for me although I'm using Android Device.
I recommend using .getJson() to get an error message along with your response to know what is exactly wrong.
For my case in flutter: I used googlePlace!.autocomplete.getJson(value);
and i got the following response.
{ "error_message" : "You must enable Billing on the Google Cloud Project at https://console.cloud.google.com/project/_/billing/enable Learn more at https://developers.google.com/maps/gmp-get-started", "predictions" : [], "status" : "REQUEST_DENIED" }
That's the wrong API key. Follow the steps here to get the right one.
Make sure you API keys are generated correctly and that you have enabled the necessary APIS.
In my case, when designing iOS application - I need to enable Google Maps SDK for iOS, Google Places API for iOS
And most importantly, and without being mentioned by Google (in any other place as well) enable Google Places API Web Service.
With this, I ended a 2 day search for my pesky problem.
And, of course, make sure you use Key for server applications

Categories

Resources