Skip to content

Instantly share code, notes, and snippets.


lepture/ Secret

Last active Jun 16, 2018
What would you like to do?
Authlib v0.8 Changes


create_expires_generator has been renamed to create_token_expires_in_generator. If you haven't created a subclass of Flask AuthorizationServer, or you haven't overwrote create_expires_generator, there is nothing to change.

If you need to rewrite the create_expires_generator method, you need to change it to:

class MyAuthorizationServer(AuthorizationServer):
    def create_token_expires_in_generator(self, app):

Token Generator

access_token_generator and refresh_token_generator has been changed to accept parameters. Now it accepts 4 parameters, so that you can generate a token with these context:

def token_generator(client=None, grant_type=None, user=None, scope=None, **kwargs):
    return your_func(client, grant_type, user, scope)

This change is compitable, you will get a deprecate message.


This comment has been minimized.

Copy link
Owner Author

@lepture lepture commented May 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment