Skip to content

Instantly share code, notes, and snippets.

@lepture

lepture/CEG.md Secret

Last active June 16, 2018 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lepture/ba41f2b5148d4f752b02e0cfcec36ec6 to your computer and use it in GitHub Desktop.
Save lepture/ba41f2b5148d4f752b02e0cfcec36ec6 to your computer and use it in GitHub Desktop.
Authlib v0.8 Changes

create_expires_generator

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.

@lepture
Copy link
Author

lepture commented May 25, 2018

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