Skip navigation
Documentation

Duo Single Sign-On for Generic SAML Service Providers

Last Updated: November 30th, 2022

Add two-factor authentication and flexible security policies to any SAML application with Duo Single-Sign On, our cloud-hosted SAML 2.0 identity provider, complete with inline self-service enrollment and Duo Prompt.

About Duo Single Sign-On

Duo Single Sign-On is our cloud-hosted SSO product which layers Duo's strong authentication and flexible policy engine on top of an application's login using the Security Assertion Markup Language (SAML) 2.0 or OpenID Connect (OIDC) authentication standards. Duo Single Sign-On acts as an identity provider (IdP), authenticating your users using existing on-premises Active Directory (AD) or any SAML 2.0 IdP and prompting for two-factor authentication before permitting access to your service provider application.

Duo Single Sign-On is available in Duo Beyond, Duo Access, and Duo MFA plans, which also include the ability to define policies that enforce unique controls for each individual SSO application. For example, you can require that users of one application complete two-factor authentication at every login, but only once every seven days when accessing a different application. Duo checks the user, device, and network against an application's policy before allowing access to the application.

Configure Single Sign-On

Before configuring your service provider application you'll first need to enable Duo Single Sign-On for your Duo account and configure a working authentication source.

Once you have your SSO authentication source working, continue to the next step of creating the SP application in Duo.

We've already added a number of popular SaaS applications to Duo pre-configured for use with Duo Single Sign-On. These applications have "Single Sign-On (hosted by Duo)" next to their name. If you want to protect a cloud service that we don't have listed by name, you can use our Generic SAML Service Provider application.

When configuring an application to be protected with Duo Single Sign-On you'll need to send attributes from Duo Single Sign-On to the application. Active Directory will work with no additional setup, but if you used a SAML idenity provider as your authentication source please verify that you configured it to send the correct SAML attributes.

Below you can see the Bridge Attribute name used that automatically maps certain attributes from your authentication source.

Bridge Attribute Active Directory SAML IdP
<Username> sAMAccountName Username
<Email Address> mail Email
<Display Name> displayName DisplayName
<First Name> givenName FirstName
<Last Name> sn LastName

Create Your Cloud Application in Duo

  1. Log on to the Duo Admin Panel and navigate to Applications.

  2. Click Protect an Application and locate the entry for Generic SAML Service Provider with a protection type of "2FA with SSO hosted by Duo (Single Sign-On)" in the applications list. Click Protect to the far-right to start configuring Generic SAML Service Provider. See Protecting Applications for more information about protecting applications in Duo and additional application options. You'll need the information on the Generic SAML Service Provider page under Metadata later.

  3. The Metadata section is where you can get SAML identity provider information about Duo Single Sign-On to provide to your service provider.

Name Description
Entity ID The global, unique name for Duo Single Sign-On. This is sometimes referred to as "Issuer".
Single Sign-On URL The authentication URL for Duo Single Sign-On. This is sometimes referred to as "SSO URL" or "Login URL". This URL can also be used to start IdP-initiated authentications.
Single Log-Out URL The logout URL for Duo Single Sign-On. This is sometimes referred to as "SLO URL" or "Logout Endpoint". This field is optional.
Metadata URL This URL can be used by service providers to download the XML metadata from Duo Single Sign-On.
SHA - 1 Fingerprint The SHA-1 fingerprint of the SAML certificate. Sometimes service providers will request a fingerprint instead of uploading a SAML certificate.
SHA - 256 Fingerprint The SHA-256 fingerprint of the SAML certificate. Sometimes service providers will request a fingerprint instead of uploading a SAML certificate.
Certificate The certificate used by the service providers to validate the signature on the SAML response sent by Duo Single Sign-On. Click the Download Certificate button to download a crt file.
SAML Metadata The XML SAML Metadata used by service providers to configure the service provider with settings from Duo Single Sign-On. Click the Download XML button to download a xml file.
Metadata for configuring generic SAML service providers

Configure Your Service Provider

You'll need to provide some information about Duo Single Sign-On to your cloud application provider, like URL information, a metadata file, a certificate file, or a certificate fingerprint. You can find this information in the Metadata section at the top of the application page in the Duo Admin Panel.

Refer to your service provider's SSO configuration guide for instructions.

Update Your Cloud Application in Duo

  1. Return to the application page in your Duo Admin Panel.

  2. Enter information provided by your application into the Service Provider section:

    Name Description
    Entity ID The service provider identifier.
    Assertion Consumer Service (ACS) URL The URL where your service provider receives SAML assertions. You can click Add an ACS URL if your service provider supplies more than one URL. The field will change to show additional options to specify optional Index and isDefault fields per URL. If you are unsure about these settings, leave them blank. Please refer to your Service Provider for ACS URL details.
    Single Logout URL Optional: The URL where your service provider receives SAML logout responses.
    Service Provider Login URL Optional: The URL for IdP-initiated logins if your service provider specifies one. This URL will be used when doing an IdP-initiated login from Duo Single Sign-On by either navigating directly to the "Single Sign-On URL" from the metadata section or clicking this application's tile in Duo Central.
    Default Relay State Optional: If your service provider requires a specific RelayState parameter, enter it here.
    Configuring generic SAML service providers
  3. Use your application's SSO instructions to complete the SAML Response section:

    Name Description
    NameID format Format of NameID when sent to the service provider.
    NameID attribute The authentication source attribute used to identify the user to the service provider. This attribute is sent as the NameID. This is often a user's e-mail address. You can select our pre-configured attributes which will automatically pick the correct attribute based on your authentication source from the drop-down or use your own.
    Signature Algorithm Select the encryption strength supported by your service provider. Defaults to SHA-256.
    Signing Options Here you can toggle if you'd like to sign the SAML response and assertion by checking the boxes next to Sign response and Sign assertion. They are both checked by default.
    Map attributes If your service provider requires specific attributes sent, you can map the authentication source attributes to the required names here. On the left side you can select our pre-configured attributes which will automatically pick the correct attribute based on your authentication source from the drop-down or use your own and on the right side type the new attribute name you want sent to your service provider. Consult your service provider's documentation for the required attribute names.
    Create attributes If your service provider requires an attribute with a specific value, you can define that here. Enter the new attribute name on the left, and the static attribute value on the right. Consult your service provider's documentation for the required attribute names.
    Role attributes If your service provider requires an attribute related to the roles or groups of a user, specify that in the “Role attributes” section. Type the Attribute Name required by the service provider, and then under Service Provider’s Role type the value of the attribute that should be sent and under Duo Groups select the Duo Groups a user should be part of to get that role added to their SAML response.
    Attribute Transformations Attribute Transformations is an advanced feature that allows you to modify the IdP attribute value before putting it into the SAMLResponse. See how to use attribute transformations.
    Configuring generic SAML service providers
  4. You can adjust additional settings for your new SSO application at this time — like changing the application's name from the default value, enabling self-service, or assigning a group policy.

  5. Scroll down to the bottom of the page and click Save.

Attribute Transformations

Attribute Transformations is an advanced feature that allows you to modify an attribute value before it is sent to the SAML service provider. The most common reason to modify an attribute is that the service provider requires an attribute in a certain format that isn't available from your authentication source. An example is that some service providers offer sandbox environments but require that the username end in .sandbox. This isn't something you'd typically have stored in your authentication source so you wouldn't be able to protect that sandbox account using SSO. Attribute Transformations solves this problem by allowing you to modify your attributes.

Attribute Transformations work by operating on a list of rules from top to bottom to transform an attribute into exactly what you need. The attribute selected on the first line is used as the primary attribute to be transformed. All rules after the primary attribute was specified will continue to modify this same attribute. The list of rules can be seen below.

When specifying attributes you can use either the direct attribute name from your authentication source or one of the five bridge attributes. When using a bridge attribute type in the exact bridge attribute name as seen in the table at the top of the page, such as: <Email Address>.

Each rule should be on its own separate line and go in order from top to bottom of how you'd like the attribute transformed.

Rule format is:

$RULE_NAME $OPTION="$OPTION_VALUE"

A rule can have more than one option and the option name must always be followed by an = and the option value encapsulated in quotes.

Rule Name Description Options Examples
use Always used as the first rule to define the primary attribute that is being modified. The attribute name should always be encapsulated in quotes. No options.
  • use "mail"
prepend This rule can be used to allow you to prepend static text or the value of another attribute from your authentication source to the start of your primary attribute.
  • text: Static text that will be added to the start of the attribute. Must use this or additional_attr but not both.
  • additional_attr: The name of another authentication source attribute that will be added to the start of your primary attribute. Must use this or text but not both.
  • prepend text="admin-"
  • prepend additional_attr="sAMAccountName"
append This rule can be used to allow you to append static text or the value of another attribute from your authentication source to the end of your primary attribute.
  • text: Static text that will be added to the end of the attribute. Must use this or additional_attr but not both.
  • additional_attr: The name of another authentication source attribute you'd like to add to the end of your primary attribute. Must use this or text but not both.
  • append text="@example.com"
  • append additional_attr="domain_name"
insert_before This rule can be used to allow you to add static text or the value of another attribute from your authentication source before a delimiter that you specify.
  • delimiter: The character that will be used to identify where to add text before. Required.
  • text: Static text that will be added before the delimiter. Must use this or additional_attr but not both.
  • additional_attr: The name of another authentication source attribute you'd like to added before the delimiter. Must use this or text but not both.
  • insert_before delimiter="@" text="-admin"
  • insert_before delimiter="@" additional_attr="sAMAccountName"
insert_after This rule can be used to allow you to add static text or the value of another attribute from your authentication source after a delimiter that you specify.
  • delimiter: The character that will be used to identify where to add text after. Required.
  • text: Static text that will be added after the delimiter. Must use this or additional_attr but not both.
  • additional_attr: The name of another authentication source attribute you'd like to added after the delimiter. Must use this or text but not both.
  • insert_after delimiter="@" text="example"
  • insert_after delimiter="@" additional_attr="domain_name"
keep_before This rule can be used to remove text from your attribute after the delimiter, keeping only what was before it.
  • delimiter: The character that will be used to identify where to split the text and keep only what was before it. Required.
  • keep_before delimiter="@"
keep_after This rule can be used to remove text from your attribute before the delimiter, keeping only what was after it.
  • delimiter: The character that will be used to identify where to split the text and keep only what was after it. Required.
  • keep_after delimiter="@"
make_uppercase Uppercases the entire text of the attribute. No options
  • make_uppercase
make_lowercase Lowercases the entire text of the attribute. No options
  • make_lowercase
format_ad_groups This rule can be used to automatically filter Active Directory groups from their LDAP path name to only contain the group names.
  • filter: When specified, will only return group names that contain the word specified in the filter. You may use filter or startswith but not both. Optional.
  • explicit: Can be optionally used with option filter. When set to true will only return a group name that exactly matches the filter name. Optional.
  • startswith: When specified, will only return group names that start with the word specified. You may use startswith or filter but not both. Optional.
  • format_ad_groups
  • format_ad_groups filter="admin"
  • format_ad_groups filter="admin-aws" explicit="true"
  • format_ad_groups startswith="enterprise"

Examples

Below are some examples of different scenarios and how you can transform the attributes to solve your problem.

Example 1

A service provider requires that all your email addresses end in .sandbox but you don't have an attribute in your authentication source that does.

For this example lets say you have an email attribute named mail and your user's email is jdoe@example.com

use "mail"
append text=".sandbox"
  • Line 1 picks the mail attribute from your authentication to use for all rules below it. Our example user would be 'jdoe@example.com'.
  • Line 2 appends the text value to the end of the mail attribute. Our example value would be changed to jdoe@example.com.sandbox
Example 2

You need to change the domain of an email address attribute to be from example.com to acme.com

For this example lets say you have an email attribute named mail and your user's email is jdoe@example.com

use "<Email Address>"
keep_before delimiter="@"
append text="@acme.com"
  • Line 1 picks the mail attribute from your authentication to use for all rules below it. Our example user would be 'jdoe@example.com'.
  • Line 2 keeps only the text before the delimiter. Our example value would be changed to 'jdoe'.
  • Line 3 appends the text value to the end of the mail attribute. Our example value would be changed to 'jdoe@acme.com'.

How to enable attribute transformations

  1. Next to Attribute Transformations check the box for Enable User Attribute Transformations. New options will appear below.

  2. On the left-hand side under Transformation Rules you can use the rules above to fill out the textbox with how you'd like to transform an attribute.

  3. On the right-hand side you can either check the box next to Set this as my NameID attribute to use the transformed attribute as your NameID attribute or under SAML Response Attribute type the new attribute name you want sent to your service provider.

    Note: You can only set one attribute transformation to the NameID attribute at a time. This will replace your NameID attribute value you specified further up the page.

  4. If you'd like to add additional attributes to transform click Add another transformation.

Attribute Transformations

Duo Universal Prompt

The new Universal Prompt provides a simplified and accessible Duo login experience for web-based applications, offering a redesigned visual interface with security and usability enhancements.

Universal Prompt Traditional Prompt
 Duo Push in Universal Prompt  Duo Push in Traditional Prompt

We've already updated the Duo generic SAML service provider application hosted in Duo's service to support the Universal Prompt, so there's no action required on your part to update the application itself. You can activate the Universal Prompt experience for users of new and existing Duo generic SAML service provider applications from the Duo Admin Panel.

Before you activate the Universal Prompt for your application, it's a good idea to read the Universal Prompt Update Guide for more information about the update process and the new login experience for users.

Activate Universal Prompt

Activation of the Universal Prompt is a per-application change. Activating it for one application does not change the login experience for your other Duo applications.

The "Universal Prompt" area of the application details page shows that this application is "New Prompt Ready", with these activation control options:

  • Show traditional prompt: (Default) Your users experience Duo's traditional prompt when logging in to this application.
  • Show new Universal Prompt: Your users experience the Universal Prompt when logging in to this application.

Universal Prompt Info - Application Ready for Universal Prompt

Enable the Universal Prompt experience by selecting Show new Universal Prompt, and then scrolling to the bottom of the page to click Save.

Once you activate the Universal Prompt, the application's Universal Prompt status shows "Update Complete" here and on the Universal Prompt Update Progress report.

Universal Prompt Info - Universal Prompt Activation Complete

Should you ever want to roll back to the traditional prompt, you can return to this setting and change it back to Show traditional prompt.

Universal Update Progress

Click the See Update Progress link to view the Universal Prompt Update Progress report. This report shows the update availability and migration progress for all your Duo applications in-scope for Universal Prompt support. You can also activate the new prompt experience for multiple supported applications from the report page instead of visiting the individual details pages for each application.

Verify SSO

You can log into most applications using SSO by visiting their website directly.

You can log into your application using Duo Central, our cloud-hosted portal which allows users to access all of their applications in one spot. Link to your application in Duo Central by adding it as an application tile. Once the tile has been added, log into Duo Central and click the tile for your application.

If your application supports IdP-initiated login, you can also use the Single Sign-On URL located under the "Metadata" section at the top of the application page in the Duo Admin Panel.

When you log into an application provided by Duo's Single Sign-On, you will be redirected to Duo Single Sign-On to begin authentication.

Active Directory Login

With Active Directory as the Duo SSO authentication source, enter the primary username (email address) on the Duo SSO login page and click or tap Next.

Duo Single Sign-On Login

Enter the AD primary password and click or tap Log in to continue.

Duo Single Sign-On Password

SAML Login

With another SAML identity provider as the Duo SSO authentication source, Duo SSO immediately redirects the login attempt to that SAML IdP for primary authentication. Users do not see the Duo SSO primary login screen.

Duo Authentication

Successful verification of your primary credentials by Active Directory or a SAML IdP redirects back to Duo. Complete Duo two-factor authentication when prompted and then get redirected back to the service provider application to complete the login process.

Duo Universal Prompt

*Universal Prompt experience shown.

If your application doesn't support IdP-initiated login you can modify the Service Provider Login URL on the application's page in the Duo Admin Panel to redirect to a different URL during IdP-initiated login.

Enable Remembered Devices

To minimize additional Duo two-factor prompts when switching between your service provider application and your other Duo Single Sign-On SAML applications, be sure to apply a shared "Remembered Devices" policy to your SAML applications.