Configuration

All aioauth settings are made through aioauth.config.Settings class.

Defaults

Setting

Default value

Description

TOKEN_EXPIRES_IN

86400

Access token lifetime.

AUTHORIZATION_CODE_EXPIRES_IN

300

Authorization code lifetime.

INSECURE_TRANSPORT

False

Allow connections over SSL only. When this option is disabled server will raise “HTTP method is not allowed” error.

the default settings can be changed as follows:

import os
from aioauth.config import Settings

settings = Settings(
    INSECURE_TRANSPORT=not os.getenv('DEBUG', False)
)

this example disables checking for insecure transport, depending on the debug mode of the current environment.

The aioauth.requests.Request consumes an instance of the aioauth.config.Settings class:

import os
from aioauth.config import Settings
from aioauth.requests import Request

settings = Settings(
    INSECURE_TRANSPORT=not os.getenv('DEBUG', False)
)

request = Request(
    settings=settings,
    ...
)