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

Custom access_token generator #42

rizarsyi opened this issue Sep 14, 2013 · 1 comment


Copy link

commented Sep 14, 2013

I'm working on OAuth2Provider, i need to passing a custom access_token generator. but flask_oauthlib did not send token_generator to oauthlib.

this is part of code in flask-oauthlib/provider/ :

class OAuth2Provider(object)
    def server(self):
        return Server(self._validator, token_expires_in=expires_in)

this is part of code in oauthlib/oauth2/rfc6749/endpoints/ :

class Server(AuthorizationEndpoint, TokenEndpoint, ResourceEndpoint):
def __init__(self, request_validator, token_expires_in=None, 
         token_generator=None, *args, **kwargs):
    bearer = BearerToken(request_validator, token_generator, expires_in=token_expires_in) 

so the problem is token_generator is always None right?
so i have to create a subclass to override the server() on flask-oauthlib.

i want to discuss with you about this before i made some pull request :) Thanks


This comment has been minimized.

Copy link

commented Sep 16, 2013

@lepture its works thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.