Skip to content
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

OAuthToken not being set after getAccessToken() success. #21

Closed
JesseObrien opened this issue Mar 18, 2015 · 6 comments
Closed

OAuthToken not being set after getAccessToken() success. #21

JesseObrien opened this issue Mar 18, 2015 · 6 comments

Comments

@JesseObrien
Copy link

Hi, I'm doing OAuth.getAccessToken(credentials) and getting a successful hit on the server. The token is coming back fine, nothing wrong with request cycle. The issue happens when I call OAuth.isAuthenticated() after getAccessToken() runs, it always returns false. I stepped through the code and have a screenshot below. It looks like the OAuthToken.token is still undefined even after being set directly when the request comes back successful. I have the response.data on the right side and the breakpoint set right after the token should be set. Any help would be appreciated :)

@ruipenso
Copy link
Member

Are you using https? If so, you'll need to configure OAuthToken to accept a secure cookie, e.g.,

OAuthTokenProvider.configure({
  name: 'token',
  options: {
    secure: true,
    path: '/'
  }
});

We'll consider to add this automatically to OAuthTokenProvider.

@JesseObrien
Copy link
Author

Hah, I'm currently just doing http calls and not https but the default token options have secure: true. I changed that to false and it's working now. Thanks a lot!

@nicogarcia
Copy link

Please, warn in the README that using 'http' with default OAuthTokenProvider configuration would lead to have token undefined. In a previous attempt to use the library, I gave up using it because of this. In this attempt I fortunately read this issue! Thanks!

@ruipenso
Copy link
Member

@nicogarcia Thanks for reporting your issue. I created an issue to fix this in a more clever way. I'll probably be able to fix this next week.

@jguittard
Copy link

up

@quocble
Copy link

quocble commented May 10, 2016

Thanks goodness for this issue. I encountered exact same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants