-
Notifications
You must be signed in to change notification settings - Fork 206
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
add FromCookie token extractor #10
Conversation
return cookie.Value, nil | ||
} else { | ||
return "", nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The } else { can be eliminated, ala
if cookie != nil {
return cookie.Value, nil
}
return "", nil
I've built basically the same thing. Cookies are a reasonably common place to store JWTs in non-SPAs, and I feel like support here would be greatly appreciated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this PR is not accepted?
Hi Auth0 team, can you provide more context as to why this isn't merged? This feels like a pretty common use case (e.g. read from cookie, if it's not there read the |
I agree with @donatj and @alokedesai . Authorization header is not always the best place to put the token, even for SPA application, because it is vulnerable to XSS exploit. With http-only cookies, token are vulnerable to CSRF attacks only, but on my opinion, that's easier secure with a simple CSRF token. In that configuration, the token itself is not accessible for an attacker. |
I apologize that this has not been looked at or merged in. We are starting work on a v2 and would be happy to take a look at this as part of that effort. |
No description provided.