SAML2

Tabla de contenidos

SAML 2.0 (Security Assertion Markup Language 2.0) is an authentication and authorization standard between domains based on security tokens. Below is an explanation of how to configure SAML2 in Athento to enable single sign-on (SSO) with your identity provider (IdP).

IdP Requirements

The Identity Provider (IdP) must provide the XML descriptor (metadata) that Athento needs to establish trust.

  • If the IdP offers an accessible URL with the descriptor, Athento can link directly to that path.
  • If there is no public URL, you can host the XML file on the Athento server itself.

Associate the URL or the local file using Athento configuration attributes: METADATA_AUTO_CONF_URL or METADATA_LOCAL_FILE_PATH. This configuration is done within the SAML2_AUTH property of the local_settings.py file, with a structure like the one in the example.

Attribute mapping

For Athento to be able to complete user data with the information coming from the IdP, it is necessary to map the received attributes to Athento user properties. To do so, use ATTRIBUTES_MAP.

SAML2_AUTH = {
    'METADATA_LOCAL_FILE_PATH': '/etc/saml2/athento/athento-metadata2.xml',
    'ASSERTION_URL': 'https://saml2.athento.com',
    'CREATE_USER': 'TRUE',
    'NEW_USER_PROFILE': {
        'USER_GROUPS': []
    },
    'ENTITY_ID': 'https://saml2.athento.com/saml2sso/acs/',
    'NAME_ID_FORMAT': None,
    'FRONTEND_URL': 'https://saml2.athento.com',
    'ATTRIBUTES_MAP': {
        'email': 'mail',
        'username': 'mail',
        'first_name': 'givenName',
        'last_name': 'sn',
    }
}

What information does Athento use for the SAML2 configuration?

The usual parameters to generate the metadata file are:

  • Entity ID: it is usually a URL of the type https://SUBDOMINIO.athento.com/saml2sso/acs/
  • Assertion URL: https://SUBDOMINIO.athento.com
  • User attributes: at a minimum, those shown in the following mapping are recommended. Note that email, username, first_name and last_name are the ones used by Athento, while mail, givenName and sn are common examples in the IdP (adjust as appropriate).
'ATTRIBUTES_MAP': {
    'email': 'mail',
    'username': 'username',
    'first_name': 'givenName',
    'last_name': 'sn',
}

To find out the exact subdomain of your instance, send a request to soporte@athento.com.

What do I need to send Athento to perform the SAML2 configuration?

To request the SAML2 configuration, send an email to soporte@athento.com with the following:

  1. The XML metadata file, which must be uploaded as “File config property” with the name SAML2_AUTH_METADATA_LOCAL_FILE_PATH from the advanced system administration.
  2. The equivalent attributes for email, username, first_name and last_name.

Configuration options

Authentication with SAML2 allows additional configurations, for example:

  • DEFAULT_TEAM_NAME (string): allows you to indicate the internal name of the team in which users will be created by default.
  • CHECK_USER_HAS_INTERNAL_GROUPS (bool): allows you to indicate whether the user is required to have a group assigned in Athento to allow access. IMPORTANT: the user must be created manually in Athento before their first authentication.
  • CHECK_USER_IN_GROUPS (string list): allows you to indicate the name of the groups that the user must have assigned in the user directory to allow access to Athento.

How can I update the XML metadata file?

The XML metadata file can be updated. To do so, find the SAML2_AUTH_METADATA_LOCAL_FILE_PATH property in “File config property” from the advanced system administration. There, edit it and upload the new file.