Pass Device Context to SAML apps using Limited Access

Limited Access allows you configure Okta to pass device context to certain SAML apps through the SAML assertion exchanged during authentication. The apps can then use that information to limit access to certain app-specific behaviors, such as user permissions to edit the application or to download files from the application.

This feature works with:

  • Windows, macOS, iOS, and Android devices
  • Custom and OIN SAML app integrations able to consume the device context attribute

Prerequisites

In the Okta Admin Console

  • Enable Device Trust in the Okta Admin Console (Security > Device Trust)
  • Configure a Device Trust sign on policy for the app integration (Applications > app > Sign On tab)

For details, see the Device Trust document appropriate for your implementation.

In the external application

Configure the external application to consume the device context received in the SAML assertion and specify the behaviors you want to control based on that context.

Supported attribute values

When this feature is configured, Okta passes one of the following attribute values to the external application in the SAML assertion, according to the Attribute Statement and app integration sign on policy you configure in Okta.

Attribute Value

Definition

TRUSTED User’s device is trusted as defined by the Okta app integration sign-on policy
NOT_TRUSTED User’s device is untrusted as defined by the Okta app integration sign-on policy
UNKNOWN

The device context is unknown because one or both of the following is true:

  • Device Trust is not enabled for the given device type (Security > Device Trust)
  • Device Trust is not configured in the app integration sign on policy (Applications > app > Sign On > Sign On Policy)
Info

Notes

  • The Attribute Value passed to the external application is enforced for the duration of the session.
  • You can use Okta Expression Language to map Okta terminology to ISV-specific terminology.

Procedure

  1. Complete the Prerequisites.
  1. If you have not done so already, create a custom app integration or add an OIN app integration through the Okta Admin Console.
  2. Add an Attribute Statement to the app integration (for more details, see Define Attribute Statements):

    You can add the statement while creating a new app integration or as an edit to an existing app integration.

  3. When creating the app integration:

    In Step 2: Configure SAML, scroll to the section Attribute Statements (Optional).

    – or –

    To edit an existing app integration:

    The procedure varies depending on whether you are editing a custom app integration or an OIN app integration.

    If editing a custom app integration:

    1. In the Okta Admin Console, go to Applications > Applications.
    2. Click the custom SAML app.
    3. Go to the General tab, scroll to the section SAML Settings, and then click Edit.
    4. Click Next.
    5. Scroll to the section Attribute Statements (Optional).
    6. Continue to Step 4 below.

    If editing an OIN app

    1. In the Okta Admin Console, go to Applications > Applications.
    2. Click the OIN SAML app integration.
    3. Go to the Sign On tab, scroll to the section Attribute Statements (Optional), and then click Edit.
    4. Continue to Step 4 below.

  4. In Name, enter a name for the attribute you want to add.
  5. The maximum length for this field is 512 characters. The Name attribute must be unique across all of the user and group attribute statements.

  6. In Name format, select Unspecified.
  1. In Value, select device.trusted.
  2. The maximum length for this field is 1024 characters.

    You can use the Okta Expression Language to transform the value as needed for your use case.

    For example, to map Okta terms for a trusted device context to relevant Salesforce terms, you would enter this statement in the Value field:

    device.trusted == "TRUSTED" ? "HIGH ASSURANCE" : "STANDARD"

    The above statement transforms terms as follows:

    Okta device context attribute

    Salesforce term

    TRUSTED

    HIGH ASSURANCE

    NOT_TRUSTED

    STANDARD
    UNKNOWN STANDARD
  3. To add an additional statement row, click Add Another. Repeat until all necessary attributes are defined.
  4. Click Next.
  5. Click Finish when done.

Attribute Statement details

Here is an Attribute Statement sent to an external application through the SAML Assertion that shows the device context of an untrusted device:

<?xml version="1.0"?>

<saml2:AttributeStatement xmlns:saml2="urn:oasis:names:tc:SAML:2.0:assertion">

<saml2:Attribute Name="DeviceTrustSignal" NameFormat="urn:oasis:names:tc:SAML:2.0:attrname-format:unspecified">

<saml2:AttributeValue xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">NOT_TRUSTED</saml2:AttributeValue>

</saml2:Attribute>

</saml2:AttributeStatement>

Related topics

The Applications Page

Okta Device Trust solutions

Create a SAML integration using AIW

Create new app integrations

Expression Language