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

Introspection of refresh token during access token validation #207

Closed
beornf opened this issue Aug 5, 2017 · 4 comments
Closed

Introspection of refresh token during access token validation #207

beornf opened this issue Aug 5, 2017 · 4 comments

Comments

@beornf
Copy link
Contributor

beornf commented Aug 5, 2017

According to oauth2 the refresh token is only used to generate a new access token and not read/write content on the resource server. As per the spec RFC 6749 section 1.5

Unlike access tokens, refresh tokens are intended for use only with authorization servers and are never sent to resource servers.

I am using the introspect token method in http middleware to validate access tokens, however this line allows refresh tokens to pass as well: https://github.com/ory/fosite/blob/master/handler/oauth2/introspector.go#L29.

Is my conclusion right that it would be better to check the passed in tokenType explicitly?

@aeneasr
Copy link
Member

aeneasr commented Aug 7, 2017

Token introspection RFC allows both refresh and access token validation :) I find this confusing as well, but see for yourself: https://tools.ietf.org/html/rfc7662#section-2.1

@beornf
Copy link
Contributor Author

beornf commented Aug 9, 2017

Right so that parameter is the token type hint. I'm still looking for a way for the introspection endpoint to only validate access tokens and ignore refresh tokens as these shouldn't be accepted by the resource server.

Would bringing the warden strategy from hydra into fosite as a custom factory be useful or is too much outside the oauth2 standard?
https://github.com/ory/hydra/blob/master/warden/warden_strategy.go

@aeneasr
Copy link
Member

aeneasr commented Aug 9, 2017

Hm, maybe make this configurable in the standard validator? The token_hint is not binding, only something to reduce processing time, don't rely on it :)

@aeneasr
Copy link
Member

aeneasr commented Feb 6, 2018

Addressed and closed in #208

@aeneasr aeneasr closed this as completed Feb 6, 2018
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