CSLApplication

Qualified name: intranet.apps.oauth.models.CSLApplication

class intranet.apps.oauth.models.CSLApplication(*args, **kwargs)[source]

Bases: AbstractApplication

Extends the default OAuth Application model to add CSL-specific information about an OAuth application. Disables the implicit, password, and OpenID connect hybrid grant types. Disables use of an OIDC algorithm.

sanctioned

Whether the application is sanctioned by the tjCSL.

Type:

bool

sanctioned_but_do_not_skip_authorization

Whether to not skip the authorization page for this application even if it is sanctioned.

Type:

bool

user_has_oauth_and_api_access

Whether the user associated with the CSLApplication has OAuth and API access.

Type:

bool

Parameters:
  • id (BigAutoField) – Primary key: Id

  • client_id (CharField) – Client id

  • redirect_uris (TextField) – Redirect uris. Allowed URIs list, space separated

  • post_logout_redirect_uris (TextField) – Post logout redirect uris. Allowed Post Logout URIs list, space separated

  • client_type (CharField) – Client type

  • client_secret (ClientSecretField) – Client secret. Hashed on Save. Copy it now if this is a new secret.

  • created (DateTimeField) – Created

  • updated (DateTimeField) – Updated

  • name (CharField) – Name

  • authorization_grant_type (CharField) – Authorization grant type

  • algorithm (CharField) – Algorithm

  • sanctioned (BooleanField) – Sanctioned. Whether this application is sanctioned by the tjCSL.

  • skip_authorization (BooleanField) – Skip authorization. Skip the authorization page for this application. This will automatically be set to true upon save if this application is marked as sanctioned by the CSL.

  • sanctioned_but_do_not_skip_authorization (BooleanField) – Sanctioned but do not skip authorization. Set to true if this application is sanctioned but you do NOT want to skip the authorization page for this application. Overrides automatically skipping authorization for sanctioned applications.

Relationship fields:

Parameters:

user (ForeignKey to User) – User (related name: oauth_cslapplication)

Reverse relationships:

Parameters:
  • app (Reverse ForeignKey from App) – All apps of this csl application (related name of oauth_application)

  • grant (Reverse ForeignKey from Grant) – All grants of this csl application (related name of application)

  • accesstoken (Reverse ForeignKey from AccessToken) – All access tokens of this csl application (related name of application)

  • refreshtoken (Reverse ForeignKey from RefreshToken) – All refresh tokens of this csl application (related name of application)

  • idtoken (Reverse ForeignKey from IDToken) – All id tokens of this csl application (related name of application)

Methods

get_algorithm_display

Shows the label of the algorithm.

get_authorization_grant_type_display

Shows the label of the authorization_grant_type.

get_client_type_display

Shows the label of the client_type.

get_next_by_created

Finds next instance based on created.

get_next_by_updated

Finds next instance based on updated.

get_previous_by_created

Finds previous instance based on created.

get_previous_by_updated

Finds previous instance based on updated.

save

Attributes

ALGORITHM_TYPES

CLIENT_CONFIDENTIAL

CLIENT_PUBLIC

CLIENT_TYPES

GRANT_AUTHORIZATION_CODE

GRANT_CLIENT_CREDENTIALS

GRANT_IMPLICIT

GRANT_OPENID_HYBRID

GRANT_PASSWORD

GRANT_TYPES

HS256_ALGORITHM

NO_ALGORITHM

RS256_ALGORITHM

accesstoken_set

Type: Reverse ForeignKey from AccessToken

app_set

Type: Reverse ForeignKey from App

grant_set

Type: Reverse ForeignKey from Grant

idtoken_set

Type: Reverse ForeignKey from IDToken

objects

refreshtoken_set

Type: Reverse ForeignKey from RefreshToken

sanctioned

Type: BooleanField

sanctioned_but_do_not_skip_authorization

Type: BooleanField

user

Type: ForeignKey to User

user_has_oauth_and_api_access