# Adapter

class allauth.idp.oidc.adapter.DefaultOIDCAdapter(request=None)

  The adapter class allows you to override various functionality of the `allauth.idp.oidc` app. To do so, point `settings.IDP_OIDC_ADAPTER` to your own class that derives from `DefaultOIDCAdapter` and override the behavior by altering the implementation of the methods according to your own needs.

  generate_client_id() → str

    The client ID to use for newly created clients.

  generate_client_secret() → str

    The client secret to use for newly created clients.

  get_claims(purpose: Literal['id_token', 'userinfo'], user, client, scopes: Iterable[str], email: str | None = None, **kwargs) → dict[str, Any]

    Return the claims to be included in the ID token or userinfo response.

  get_issuer() → str

    Returns the URL of the issuer.

  get_user_by_sub(client, sub: str)

    Looks up a user, given its subject identifier. Returns None if no such user was found.

  get_user_sub(client, user) → str

    Returns the “sub” (subject identifier) for the given user.

  hash_token(token: str) → str

    We don’t store tokens directly, only the hash of the token. This methods generates that hash.

  populate_access_token(access_token: dict, *, client, scopes: Iterable[str], user, **kwargs) → None

    This method can be used to alter the JWT access token payload. It is already populated with basic values.

  populate_id_token(id_token: dict, client, scopes: Iterable[str], **kwargs) → None

    This method can be used to alter the ID token payload. It is already populated with basic values. Depending on the client and requested scopes, you can expose additional information here.