-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The library fails to fetch state and access token correctly for Instagram implicit oauth #13
Comments
Please provide the link to the documentation where this can be seen. I am unable to find it. |
Oh sorry. I forgot to provide you with the documentation page. Here's the URL to the documentation: https://www.instagram.com/developer/authentication/ I looked at your library's implementation and for linkedin, since there is not fragment (hash) in the url, the popup won't be closed and the window gets redirected to the redirect url provided. Also, linkedin returns code instead of access_token (see https://developer.linkedin.com/docs/oauth2# Step 2 — Request an Authorization Code, under Application is approved), but your library searches for access_token anyways. Let me know if I can provide you with any other info :) |
Ok. If you want to tackle this, it should be made configurable with the default confirming to RFC 6749. The config could contain keys like so:
|
Awesome. Thanks for letting me do this. Do we have a task for this or should I just create a manual branch and finally create the PR to the master branch? Also, could you please give me the required permissions to create a pull request. Honestly, this is my first time ever trying to contribute to a project on Github so I'm a little bit in the dark :) |
You don't need extra permissions to create a Pull Request. Just use standard Github flow with forks: https://guides.github.com/introduction/flow/ |
👍 |
Hey @danilobuerger. I just created a PR for this. |
Based on Instagram's documentation, for the Client-Side (Implicit) Authentication they provide the response to the authentication request as below:
http://your-redirect-uri?state=STATE#access_token=ACCESS-TOKEN
As can be seen from the above, only the access token is provided as a fragment in the url. However, currently the library query-string in oauth2.js to fetch the value after the hash and searches for state and access_token in it. This process makes the library unable to fetch the state correctly and even upon successful authentication it always returns:
{type: "LOGIN_FAILURE", error: "Invalid state returned."}
as the login function's return value. I can volunteer to create a pull request to fix this.The text was updated successfully, but these errors were encountered: