Authentication
Auth client
An authentication client (an auth client for the remaining text) is a facility that allows you to define how an external application can use Corteza to authenticate and what access the authenticated users may have.
You can use Corteza to authenticate third-party applications which support OAuth2/OIDC. |
The
user interface allows you to inspect and manage your auth clients.-
list the auth clients created inside your Corteza instance.
-
create a new auth client by clicking on the new button,
-
edit an existing auth client by clicking on the edit icon next to the auth client,
-
manage global auth client permissions by clicking on the permissions button.
Listing auth clients
-
Navigate to
, -
optionally insert the filtering parameters (the list refreshes automatically).
Creating auth clients
Permissions can only be defined on existing auth clients. |
-
navigate to
, -
click on the new button in the top right corner,
-
provide the requested data,
-
press the submit button.
Grant types
Corteza authentication supports two OAuth2 grant types: authorization code and client credentials.
The authorization code grant type is used to authenticate users with the classic OAuth2 flow. To enable this grant type, select the "will be used to authenticate users (grant type = authorization_code)" option. |
|||
The client credentials grant type is the simplified authentication flow, normally used to authenticate systems, such as external services or applications.
To enable the grant type, select the "will be used to authenticate machines (grant type = client_credentials)" option. |
Defining password constraints
Corteza allows you to define custom password constraints which enable you to better conform to your security model.
Password constraints are configured on the Corteza Admin web application under
in the "password constraints" section.The minimum length parameter allows you to restrict your users from using short, insecure passwords. You can not set the minimum length below 8. The maximum password length is not configurable and is set to 256. |
|
The minimum number of numbers allows you to require your users to use numerical values in their passwords. The requirement is disabled when the value is left at 0. |
|
The minimum number of special characters allows you to require your users to use special characters in their passwords. The requirement is disabled when the value is left at 0. |
The The option should be disabled for any production deployment. If the password security is disabled, a warning message is displayed in the UI. |
Limit access
By default, any user can use any auth client. To limit access to specific auth clients, navigate to the auth client and set the "authorize client" access control rule.
If a specific role does not have the authorize client RBAC rule, the underlying users can not authenticate with the given auth client.
Define session duration
Corteza allows you to define how long the access tokens are to be considered valid.
The The access token represents the credentials that allow users to access protected resources such as records, users, and workflows. An example of limiting the access token to two minutes:
|
|
The The refresh token provides a mechanism which generates a new access token when the old one expires, removing the need to re-authenticate the user. An example of limiting the refresh token to two minutes:
|
|
The The authentication session is generated when the user provides their credentials to the Corteza login page. The authentication session is independent of access tokens. An example of limiting the auth session to two minutes:
|
|
The The authentication session is generated when the user provides their credentials to the Corteza login page. The authentication session is independent of access tokens. An example of limiting the auth session to two minutes:
|
Log out inactive users after two minutes
If you wish to log out inactive users, you need to set all three of the .env
variables mentioned above.
AUTH_OAUTH2_ACCESS_TOKEN_LIFETIME=2m
AUTH_SESSION_LIFETIME=2m
AUTH_OAUTH2_REFRESH_TOKEN_LIFETIME=2m
When the user is considered inactive is determined by the user’s browser. Usually this is when they close the tab/window or when their computer enters rest mode. |