---
title: SAML 2.0
description: Establish connections with SAML 2.0
documentId: access-control-saml2
locale: en-US
---

It is possible to establish a SAML connection with an identity provider so that users can log into Sensedia products using that provider's credentials.
The chosen provider must support the SAML 2.0 standard.

<Callout type="NOTE" title="NOTE">
- It is not possible to generate *Client Credentials* using federated logins.
- Each environment allows **only one** active federated login provider at a time.
  If there is already a provider with **Active** status, it will not be possible to activate or create another provider.
  To configure a new provider, first deactivate the active provider. Once the status has been changed, the creation or activation of another provider will be permitted.
</Callout>

<Callout type="WARNING" title="WARNING">
When you delete a federated login provider:

- Users **originally created as local users** in Access Control regain access via login and password, after a password reset.
- Users **created exclusively through federated login**, who were never local users, are permanently deleted, automatically and without prior notice. This data cannot be recovered after deletion.
</Callout>

<a id="config-plat"></a>
## Configuring a SAML 2.0 connection

Configuring a connection with an identity provider involves the following elements:

- **Name**: name of your SAML provider.
- **Enable IdP sign out flow**: Enable IdP sign out flow.
  If you want the user to also be logged out of the SAML identity provider when logging out, select this option and configure your IdP with the information shown in the two fields that will be displayed:
  - **Logout URL** (integration logout URL) and
  - **Signing certificate**.
- **Callback URL**: the URL to which your identity provider should return the user after authentication;
- **SP Entity ID**: this is how your provider will identify your entity.
  Configure your identity provider with this URN.
- **Metadata URL**: address for accessing metadata.
  Check your identity provider's documentation to locate the metadata URL and enter it in this field.
- **Role**: select the role to be applied with this access.

<Callout type="NOTE" title="NOTE">
If there are roles configured on your identity provider side, they will prevail over this one.
</Callout>

The fields are explained in the video below:

[Explanatory video about SAML 2.0 configuration](https://www.youtube.com/watch?v=nbr34H2nuQ)

## Editing or deleting a SAML 2.0 connection

Once active, the connection with the identity provider can be updated at any time.
To do this, click on any field you want to edit, make the necessary changes and click **UPDATE**.

To delete a connection, click the **Delete Login** button.

<Callout type="WARNING" title="WARNING">
- When you click **Delete Login**, the federated login provider is deleted. Users originally created as local users in Access Control regain access via login and password after a password reset; users created exclusively through federated login are permanently deleted. See the details at the top of this page.
- To re-establish the connection, follow the steps above again (Configuring a SAML 2.0 connection).
- Clicking **Delete Login** does not change your settings with your identity provider.
</Callout>

## Login and user control

Unlike what happened with login through the Sensedia Platform, now login with username and password continues to be possible even after configuring SAML 2.0.

A user will be able to log into Sensedia products both via SAML and separately.

## Configuring an API Manager application in your identity provider

To enable a SAML 2.0 connection, an API Manager application must be registered in your identity provider.

See below some **examples** of configuration using:

- [Okta](#saml2-okta)
- [Azure AD](#saml2-azure)

<Callout type="NOTE" title="NOTE">
Consult your provider's official documentation for more help with the necessary configurations.
</Callout>

<a id="saml2-okta"></a>
### Example configuration using Okta

The SAML 2.0 connection can be made with the access provider of your choice.
There are several providers, one of them is **Okta**.
To configure it, follow the steps listed below.

<Steps>
  <Step>
    **Create an Okta account**
    
    If you don't already have one, create an Okta account.
    Access via the link: [https://developer.okta.com/signup/](https://developer.okta.com/signup/)
  </Step>
  
  <Step>
    **Create a SAML 2.0 type app**
    
    To do this, click **Applications > Applications** and the **Create App Integration** button, as shown in the figure below.
    
    ![location of the Applications menu within Applications and the Create App Integration button](https://creative-ball-51b3fc85c0.media.strapiapp.com/okta_step1a_14030fca06.png)
    
    Then, in the modal screen that opens, select the SAML 2.0 option and click **Next**
    
    ![location of the SAML 2.0 option](https://creative-ball-51b3fc85c0.media.strapiapp.com/okta_step1b_b66a02555b.png)
  </Step>
  
  <Step>
    **Configure the app**
    
    Configure the app, specifying a name for the federated login, icon or logo (optional) and visibility options.
    Then click **Next**.
  </Step>
  
  <Step>
    **Fill in the configuration fields**
    
    On the next screen, fill in the fields:
    - **Single sign on URL**: Callback URL, which is based on your API Manager address: `<MANAGER-URL>/api-manager/api/v3/saml/callback`
    - **Audience URI (SP Entity ID)**: the value entered in this field will be used in API Manager as "application ID"
    - **Default RelayState**: non-mandatory field
    - **Name ID format**: select **EmailAddress**
    
    ![SAML configuration in Okta](https://creative-ball-51b3fc85c0.media.strapiapp.com/okta_step4_2215a98f86.png)
    
    Further down, in **Attribute Statements**, fill in:
    
    - **Name**: `email`
    - **Format**: `Basic`
    - **Value**: `user.email`
    
    - **Name**: `name`
    - **Format**: `Basic`
    - **Value**: `user.firstName`
    
    ![Attribute configuration](https://creative-ball-51b3fc85c0.media.strapiapp.com/okta_step4a_7303f70f30.png)
    
    Then click **NEXT** to finish the registration.
  </Step>
  
  <Step>
    **Export the metadata**
    
    On the screen that appears when you click **NEXT**, export the metadata by clicking "Identity Provider metadata is available if this application supports dynamic configuration", identified in the following image.
    
    (If the screen doesn't appear, go back to **Applications > Applications** and click on the name of the application you just created. On the next screen, click the **Sign On** tab. You should see the screen below)
    
    ![arrow indicating the location of Identity Provider metadata](https://creative-ball-51b3fc85c0.media.strapiapp.com/okta_step5_5e2185f1af.png)
    
    The screen that opens will show the content, which can be saved as metadata.xml.
    Note the URL. It will be used to configure API Manager.
  </Step>
  
  <Step>
    **Link the Okta user to the created app**
    
    To do this, click the **Assignments** tab and then click **Assign > Assign to People**, as illustrated in the image below.
    
    ![steps to link user to app](https://creative-ball-51b3fc85c0.media.strapiapp.com/okta_step6_891ac21855.png)
    
    On the screen that opens, click **Assign** next to your name and email, as illustrated in the image below.
    
    ![location of Assign](https://creative-ball-51b3fc85c0.media.strapiapp.com/okta_step6b_35a9ef87fe.png)
    
    On the next screen, click the **Save and Go Back** button.
    
    <Callout type="NOTE" title="NOTE">
    The user must be linked to the created app for them to be able to log in.
    </Callout>
  </Step>
  
  <Step>
    **Configure API Manager**
    
    After configuring Okta, enter your API Manager.
    
    Go back to the beginning of this page for more details on [configuring an integration](#config-plat) in API Manager.
    In summary, in **Access Control > Integrations**, fill in the fields:
    
    - **Name**: name you registered in step 3
    - **SP Entity ID**: name entered as *Audience URI* in step 4
    - **Metadata URL**: enter the URL you obtained in step 5
    
    Click **CONNECT**
  </Step>
</Steps>

<a id="saml2-azure"></a>
### Example configuration using Azure AD

To configure Azure AD as an identity provider, follow these steps:

<Steps>
  <Step>
    [Create a Client](#criate-client)
  </Step>
  <Step>
    [Configure SAML](#configure-saml)
  </Step>
  <Step>
    Note the [Metadata URL](#access-control-azure) to [configure your Sensedia platform](#access-control-azure)
  </Step>
</Steps>

<a id="criate-client"></a>
<a id="create-client"></a>
#### 1. Create a Client

<Steps>
  <Step>
    **Access Microsoft Entra ID**
    
    Access your Microsoft Azure account and click **Microsoft Entra ID**.
    
    ![location of Microsoft Entra ID](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step1_entra_id_0a4ec8ba24.png)
  </Step>
  
  <Step>
    **Access Enterprise Applications**
    
    Click **Enterprise Applications**.
    
    ![location of Enterprise Applications](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step2_apps_9aa9979597.png)
  </Step>
  
  <Step>
    **Create a new application**
    
    If you already have an application created for API Manager, go to [step 2 - Configure SAML](#configure-saml).
    Otherwise, click **New application**.
    
    ![location of the Create your own application button](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step3_create_app_9820ecb3f5.png)
  </Step>
  
  <Step>
    **Create your own application**
    
    Click **Create your own application**.
    
    ![location of the Create your own application button](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step4_create_own_app_247ddeed53.png)
  </Step>
  
  <Step>
    **Configure the application**
    
    Enter:
    - The name you want to give your application
    - The purpose of use of your application: select "Integrate any other application that you don't find in the gallery"
    
    ![location of the Create your own application button](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step5_create_own_app_534c9b6cda.png)
  </Step>
  
  <Step>
    **Finalize creation**
    
    Click **Create**.
    
    You will see your application properties, including its ID and object ID.
    
    ![application properties, including ID and object ID](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step6_app_properties_cb05070a68.png)
  </Step>
</Steps>

<a id="configure-saml"></a>
#### 2. Configure SAML

<Steps>
  <Step>
    **Configure single sign-on**
    
    After creating the application, still on the Overview screen, click **Configure single sign-on**.
    
    ![location of the Configure single sign-on button](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step7_configure_sso_160d0ef22e.png)
  </Step>
  
  <Step>
    **Select SAML**
    
    Click **SAML**.
    
    ![location of the SAML button](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step8_configure_saml_05196e4579.png)
  </Step>
  
  <Step>
    **Edit basic SAML configuration**
    
    If you're configuring for the first time, the **Configure Single Sign-On with SAML** screen will appear as shown in the image below.
    Click **Edit** in the "Basic SAML Configuration" section.
    
    ![location of the Edit button in the Basic SAML Configuration section](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step9_edit_saml_6ecf0bfde6.png)
  </Step>
  
  <Step>
    **Fill in the required fields**
    
    Fill in the fields:
    - **Identifier (Entity ID)**: Enter the *SP Entity ID*
    - **Reply URL (Assertion Consumer Service URL)**: Enter the *Callback URL*
    
    ![identifier and url](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_saml_identificator_url_7ae50132ae.png)
    
    <Callout type="NOTE" title="NOTE">
    The Identifier and Reply URL can be obtained from:
    
    - Access Control Settings > Federated Login
    
    ![Federated Login](https://creative-ball-51b3fc85c0.media.strapiapp.com/federated_login_d2114fd26c.png)
    
    - Click SAML2 and the **CONFIGURE FEDERATED LOGIN** button (the button will be enabled when you click SAML2)
    
    ![location of the SAML2 menu](https://creative-ball-51b3fc85c0.media.strapiapp.com/saml2_725e230f28.png)
    
    ![location of the CONFIGURE FEDERATED LOGIN button](https://creative-ball-51b3fc85c0.media.strapiapp.com/saml2_identifier_url_b5decbd2f1.png)
    </Callout>
  </Step>
  
  <Step>
    **Save settings**
    
    Click **SAVE** to save the settings.
    
    ![location of the Save button](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step10_save_saml_a509189ecf.png)
  </Step>
  
  <Step>
    **Edit attributes and claims**
    
    Click **Edit** in the "Attributes and Claims" section.
    
    ![location of the Edit button in the Attributes and Claims section](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step11_edit_attributes_451b305c0d.png)
  </Step>
  
  <Step>
    **Remove unnecessary attributes**
    
    Next to *user.givenname* and *user.surname*, click the **...** and **Delete** to remove them and then click **OK** to confirm.
    
    ![removal of givenname and surname](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step12_remove_attributes_ee3fec0932.png)
    
    After removing *user.givenname* and *user.surname*, only the *email*, *name* and *Unique User Identifier* fields should remain.
  </Step>
  
  <Step>
    **Clear namespaces**
    
    The *Namespace* of the fields that will be kept will come filled in. Clear this field.
    
    For example, the *Namespace* of the *email* field comes like this:
    
    ![location of the email field with the namespace filled](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_example_email_namespace_d44c52eff1.png)
    
    and should be like this:
    
    ![location of the email field without the namespace filled](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_example_email_namespace_clean_89faab49fb.png)
    
    Delete the content of the *Namespace* field for all three: *email*, *name* and *Unique User Identifier*.
  </Step>
</Steps>

<a id="access-control-azure"></a>
#### 3. Note the Metadata URL

<Steps>
  <Step>
    **Copy the metadata URL**
    
    In the "SAML Certificates" section, copy the content of the *App Federation Metadata Url* field.
    
    ![location of the App Federation Metadata Url field](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step13_metadata_url_32a36c6f3d.png)
  </Step>
  
  <Step>
    **Configure your Sensedia Platform**
    
    Configure your Sensedia Platform, following the steps below. If necessary, go back to the beginning of this page for more details on [configuring an integration](#config-plat) in API Manager.
    
    - Enter Access Control Settings > Federated Login
    
    ![Federated Login](https://creative-ball-51b3fc85c0.media.strapiapp.com/federated_login_d2114fd26c.png)
    
    - Click SAML2 and the **CONFIGURE FEDERATED LOGIN** button (the button will be enabled when you click SAML2)
    
    ![location of the SAML2 menu](https://creative-ball-51b3fc85c0.media.strapiapp.com/saml2_725e230f28.png)
    
    Fill in the fields:
    - **Name**: enter the same name given when [creating a client](#criate-client)
    - **Metadata URL**: enter the URL we just copied from "SAML Certificates"
    - **Role**: default role that will be assigned to users when they log in through the integration
    
    ![location of the fields](https://creative-ball-51b3fc85c0.media.strapiapp.com/azure_step14_metadata_role_5c87abfdf0.png)
    
    - Click **CREATE**
  </Step>
</Steps>

<!-- Reference: https://learn.microsoft.com/pt-br/power-apps/maker/portals/configure/configure-saml2-settings-azure-ad -->
