I have a google oauth sign in button with a redirect URI of localhost:8080/login/callback.
Whenever I sign in, the callback URL is posted with a blank authorization code. The arguments are listed below. grant_type=authorization_code&client_id=myclientid.apps.googleusercontent.com&code=None&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Flogin%2Fcallback
Why isn't it giving me a code? How can I fix this?
Related
I wish to enable user to sign in to my web page using their Twitter account, and at the same time I will query their ID, Name and eMail. This can be achieved easily using Facebook and Google. But the OAuth 1 API provided by Twitter is insanely difficult. Below is what I had done:
I have successfully invoke request_token
After that let user sign in using the authenticate page.
But I don't know how to proceed from here.
I tried to invoke verify_credentials to get Clients profile, but response was Authorization Required.
I tried to invoke authorize, but response was forbidden.
Twitter API document is NOT helpful at all.
I am having trouble signing into my web application. I am using oauth2 for sign in. After signing in with my gmail account it just brings me back to a blank white page with a google sign in button on the top left corner. the url reads: localhost:8000/login In my google api console I tried editing the authorized redirect URIs. And as well in the json file. But it doesn't seem to do anything. How do I direct the oauth2 login to the correct webpage after signing in?
console.developers.google.com/apis
I removed the 0.0.0.0 from the Authorized JavaScript origins in the google developer console.
Used Authorized JavaScript origins: http://localhost:8000
Authorized redirect URIs: http://localhost:8000/oauth2callback
And I added the GET method in addition to the POST method. #app.route('/gconnect', methods=['POST','GET']) in my application file. This worked for me.
I'm using the LinkedIn Javascript SDK on my website in order to allow users to register and log in via Linked In.
I want to achieve this without redirecting the user to Linked In, but instead via the popup window.
The issue is, I'm not sure how to securely get an access token, which I can then use to get the users profile and create an account.
Currently, via the Javascript SDK, I can log the user in without redirection, and receive a oauth_token, which I then post to by backend. My Here is my code:
IN.User.authorize(function(){
$.ajax({
type: 'POST',
url: '/auth/li/'+IN.ENV.auth.oauth_token,
});
});
This succesfuly sends the token to my server, but how do I use it to then get an access token in order to use in the backend?
I tried to simply convert it to one using the LinkedIn API with
https://www.linkedin.com/oauth/v2/accessToken
but I get an error
Unable to retrieve access token: appid/redirect uri/code verifier does not match authorization code. Or authorization code expired.
I sort of understand the error, as with the javascript SDK there is no redirect URI.
With the Facebook SDK/API, on successful authorisation via the Javascript API, a cookie encrypted with my app secret is stored, and my backend can decrypt and read it, and then finally create an account.
Is there something like that in LinkedIn that I missed?
I have the same issue, with Google and Facebook SDK I can get access_token but linkedin SDK auth_token is not working. I think we need access_token but don't know how to get that with linkedin SDK.
I have come up with a solution. I ended up not using the javascript API. What I did was generate a login URL on my server and retrieved it via AJAX. I then created a javascript popup window and aimed it at the login url. One the user authenticates, linkedin redirects to my selected redirect URL within the popup, and I can then authenticate on my side (and close the popup).
I am trying to get a request token from twitter, and I've been having some problems with it. I used twitter4J to see if it would work with that and it does, but when I use the twitter oauth tool to get a valid authorization header, and copy and paste it as the authorization header for http://api.twitter.com/oauth/request_token in the twitter developer console I get a 401 error ("failed to validate signature and token"). I have tried this same copy and paste method for other requests that require authentication and it works but it just won't work for this request. Any suggestions as to what is going on?
Ok I figured it out! The problem was that the oauth access token is included in the header when you use the twitter oauth tool, with the access token being that of the twitter account related to your application. But if you are using the request_token url you shouldn't already have that, and that is why it throws the error. Thus the twitter oauth tool is useless for a request to this url.
I am integrating Yammer in my application and I am using OAuthConsumer Component of cakephp.
After yammer authorization it is not redirecting me to the callback url.
The token generated by get_request_token function is an array having key and secret. After generating token it is redirecting me to Authorize page of Yammer but once i click Authorize button, it is displaying the code there. I am passing the callback url (http://localhost.com/test/yammer/callback) in the get_request_token also.