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

token_from required for oauth2_introspection but ignores "seperated" values #308

Closed
pike1212 opened this issue Dec 10, 2019 · 3 comments
Closed

Comments

@pike1212
Copy link
Contributor

pike1212 commented Dec 10, 2019

Describe the bug

The token_from field in oauth2_introspection appears to be required now, which is fine, but when I specify "Authorization" it no longer splits up the token field if the value is "Bearer token" in the BearerTokenFromRequest method.

@aeneasr
Copy link
Member

aeneasr commented Dec 16, 2019

I'm not sure I understand the issue?

@pike1212
Copy link
Contributor Author

If my config looks like

      token_from:
        header: Authorization

And the header is Authroization: Bearer 12345

Then oathkeeper will try to introspect Bearer 12345 instead of just 12345

https://github.com/ory/oathkeeper/blob/master/helper/bearer.go#L38

@aeneasr
Copy link
Member

aeneasr commented Dec 16, 2019

To use the Authorization header you should levae token_from empty. But I do understand that this is confusing, and that this should work properly. We should probably check here ( https://github.com/ory/oathkeeper/blob/master/helper/bearer.go#L40 ) if the value is Authorization or not and if it is, just skip the if and go to: https://github.com/ory/oathkeeper/blob/master/helper/bearer.go#L52

Would you be open for a PR?

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

2 participants