I have sucesfully installed securesocial in my play 2 app and I have it working for google and facebook. But i am having an issue with twitter
My conf file has the following
#
# Twitter
#
securesocial.twitter.requestTokenURL=https://twitter.com/oauth/request_token
securesocial.twitter.accessTokenURL=https://twitter.com/oauth/access_token
securesocial.twitter.authorizationURL=https://twitter.com/oauth/authenticate
securesocial.twitter.consumerKey=mykey
securesocial.twitter.consumerSecret=mysecret
but I am getting the following exception.
securesocial.provider.AuthenticationException: Authorization failed (server replied with a 401). This can happen if the consumer key was not correct or the signatures did not match.
My key and secret are the same as they are on my twitter API account app that I have created for this app. I have also included the website and the #anywhere domain from where this request is being called from.
Any ideas?
Make sure the time in your computer is properly set. Twitter will return that error if the local time in your computer is out of some offset compared to the time in their servers. Hope this helps.
Related
I am developing a NextJS application using next-auth with Google Oauth 2 as its authentication provider. The production build is running on Heroku. When attempting to sign in on my production build, Google OAuth is giving me "Error 400: redirect_uri_mismatch". Normally this would be an easy fix, except the exact uri is already registered in Cloud Console.
.
I have also tried added many different permutations of my uri, but this did not help.
This issue not solved by 11485271 or 69151061.
Error in question:
Error 400: redirect_uri_mismatch
You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy.
If you're the app developer, register the redirect URI in the Google Cloud Console.
Request Details
If you’re the app developer, make sure that these request details comply with Google policies.
redirect_uri: https://middcourses2.herokuapp.com/api/auth/callback/google
And here is a link to the list of authorized domains in GCP.
Solved! So for some reason, Google changed my Client ID and Client Secret after I already set up those env variables. Once I noticed the change and inputted the new values it worked fine.
For me, clientID was not the issue, but this was due to a trailing slash( / ).
redirect_uri must be an EXACT MATCH on the developers console.
In the Google Cloud console, I had http://localhost:8080 under the redirect URIs in the list while my code was sending http://localhost:8080/ while making the oAuth call.
I've been away from coding for a few years so excuse the simple nature of this question. I've downloaded the Houndify web sdk and followed instructions to get it running on my local web server (localhost). When running it I get the authentication error "signed token rejected". I've updated the config.json and index.html with my client ID and Key. Any ideas?
E W
Can you check:
if you have activated your account by clicking the link in the email
test the request from the API console from the Client dashboard page
I have had the same error and realized that my account was not activated.
I was able to successfully log in using Google Classroom and pull the course data during the trial. This was on my local machine. Now I have moved to my test server. I can still log in via google but can no longer pull the course data. I have already updated my client_secret file (updated the appropriate endpoints) but i get the following error after calling classroom.courses.list
Error: No access or refresh token is set.
Would appreciate anyone's help. I do have Google Classroom API as one of my APIs. Not sure if it's because i'm now on a domain instead of my localhost.
Sadly, I was doing a 2 part registration. The first past, I was setting the token. When the page was submitted again with new details from the user, when I was making the call to google, I hadn't set the token.
I'm using linkedin-oauth2 gem
to connect with LinkedIn Api. The following snippet gives me 403 error:
client = LinkedIn::API.new(user_access_token)
client.profile # works well
client.network_updates # gives 403 error
I gave all possible permissions to the app (including rw_nus). Any ideas?
You are getting probably this issue because you are not setting properly the scope for the omniauth gem to request this permissions on the client-side oauth2 besides how the app permissions are configured in the Linkedin developer network site.
Try addind something like
:scope => 'r_fullprofile r_contactinfo r_emailaddress r_network'
to the existing config line you might have in the Omniauth (or Devise) initializer file.
provider :linkedin, ENV['LINKEDIN_KEY'], ENV['LINKEDIN_SECRET']
Then you should get both Apps working good.
Check the permission because linkedin api is changed go through the url for more info http://www.oodlestechnologies.com/blogs/recent-changes-in-linkedin-api
I think it's a problem on LinkedIn side connected with cache. Adding permissions to the existing app doesn't work but creating app with needed permissions gives exactly what i want.
I have installed the Google Drive Realtime API sample files on my web server, following these instructions, including generating a client_id in the Cloud Console and inserting it into the index.html file.
When I visit that page and click the button to authorize the app, it pops up with a new window and shows:
Error: invalid_client
no registered origin
The Request Details are:
openid_connect_request=true
cookie_policy_enforce=false
scope=https://www.googleapis.com/auth/drive.install https://www.googleapis.com/auth/drive.file https://www.googleapis.com/auth/plus.me
response_type=token
access_type=online
redirect_uri=postmessage
proxy=oauth2relay865404532
origin=http://mywebsite.com
state=264939258|0.165356673
display=page
client_id=1077585001321.apps.googleusercontent.com
authuser=0
I can't see any other client_id that I should be using in the Cloud Console. Does anybody know how to overcome this error? Thanks for your help.
In the new Google API Console, configure your OAuth2.0 authorized origins from
Your Project > APIs & auth > Credentials
You might need to add a new Client ID specifically for a web application (I did because the default was for AppEngine)
Create Client ID > Web Application > Authorized Javascript origins
If you are running on a local dev server, just add the exact URL such as :
http://127.0.0.1:9000
UPDATE: I changed accepted answer to Johno Scott instead as he refers to the newer version of the console, whereas mine was only true for the older version.
I solved it. I needed to enter a WEB ORIGIN on the OAuth 2.0 Client ID screen. Specifically, it had to be the exact path/url of the index.html file, otherwise it defaults to the root domain which doesn't work.
This screenshot shows you exactly where it needs to be entered: