authentication_service.oidc_provider_settings module

class authentication_service.oidc_provider_settings.CustomScopeClaims(token)[source]

Bases: oidc_provider.lib.claims.ScopeClaims

A class facilitating custom scopes and claims. For more information, see http://django-oidc-provider.readthedocs.io/en/latest/sections/scopesclaims.html#how-to-add-custom-scopes-and-claims

info_roles = ('Roles', 'Roles for the requesting site')
info_site = ('Site', 'Data for the requesting site')
scope_roles() → dict[source]

The following attributes are available when constructing custom scopes: * self.user: The Django user instance. * self.userinfo: The dict returned by the OIDC_USERINFO function. * self.scopes: A list of scopes requested. * self.client: The Client requesting this claim. :return: A dictionary containing the user roles as a list

scope_site() → dict[source]

The following attributes are available when constructing custom scopes: * self.user: The Django user instance. * self.userinfo: The dict returned by the OIDC_USERINFO function. * self.scopes: A list of scopes requested. * self.client: The Client requesting this claim. :return: A dictionary containing the claims for the custom Site scope

authentication_service.oidc_provider_settings.userinfo(claims: dict, user: authentication_service.models.CoreUser) → dict[source]

This function handles the standard claims defined for OpenID Connect. IMPORTANT: No keys may be removed or added to the claims dictionary. :param claims: A dictionary with claims as keys :param user: The user for which the information is claimed :return: The claims dictionary populated with values