Reference

Flask Registry and RemoteApp

class authlib.integrations.flask_client.OAuth(app=None, cache=None, fetch_token=None, update_token=None)
create_client(name)

Create or get the given named OAuth client. For instance, the OAuth registry has .register a twitter client, developers may access the client with:

client = oauth.create_client("twitter")
Param:

name: Name of the remote application

Returns:

OAuth remote app

init_app(app, cache=None, fetch_token=None, update_token=None)

Initialize lazy for Flask app. This is usually used for Flask application factory pattern.

register(name, overwrite=False, **kwargs)

Registers a new remote application.

Parameters:
  • name – Name of the remote application.

  • overwrite – Overwrite existing config with framework settings.

  • kwargs – Parameters for RemoteApp.

Find parameters for the given remote app class. When a remote app is registered, it can be accessed with named attribute:

oauth.register('twitter', client_id='', ...)
oauth.twitter.get('timeline')

Django Registry and RemoteApp

class authlib.integrations.django_client.OAuth(cache=None, fetch_token=None, update_token=None)
create_client(name)

Create or get the given named OAuth client. For instance, the OAuth registry has .register a twitter client, developers may access the client with:

client = oauth.create_client("twitter")
Param:

name: Name of the remote application

Returns:

OAuth remote app

register(name, overwrite=False, **kwargs)

Registers a new remote application.

Parameters:
  • name – Name of the remote application.

  • overwrite – Overwrite existing config with framework settings.

  • kwargs – Parameters for RemoteApp.

Find parameters for the given remote app class. When a remote app is registered, it can be accessed with named attribute:

oauth.register('twitter', client_id='', ...)
oauth.twitter.get('timeline')

Starlette Registry and RemoteApp

class authlib.integrations.starlette_client.OAuth(config=None, cache=None, fetch_token=None, update_token=None)
create_client(name)

Create or get the given named OAuth client. For instance, the OAuth registry has .register a twitter client, developers may access the client with:

client = oauth.create_client("twitter")
Param:

name: Name of the remote application

Returns:

OAuth remote app

register(name, overwrite=False, **kwargs)

Registers a new remote application.

Parameters:
  • name – Name of the remote application.

  • overwrite – Overwrite existing config with framework settings.

  • kwargs – Parameters for RemoteApp.

Find parameters for the given remote app class. When a remote app is registered, it can be accessed with named attribute:

oauth.register('twitter', client_id='', ...)
oauth.twitter.get('timeline')