OAuth tokens vs. blocked users
This came up in gitlab-ce!8018 (discussion here): when a user is blocked/ldap-blocked, their OAuth access grants/tokens are still valid and could theoretically be used to access APIs.
My first approach was to simply deleted these tokens when a user is blocked, but that brings up a few concerns:
- users have to reauthorize their OAuth clients after they're unblocked
- revoked tokens should always be kept in the DB (see related discussion on Doorkeeper's issue tracker)
To avoid these issues, I think it would be easier to simply add a check for blocked users in AccessTokenValidationService
and return an appropriate error response (e.g. TokenNotFoundError
).
Unfortunately I currently don't have any time to look into this, so I'll leave it up to you :)
/cc gitlab-ce2677572 gitlab-ce4107687 gitlab-ce~2779335