Security enhancements: User session and access management

Applies to Dynamics 365 for Customer Engagement apps version 9.x
Applies to Dynamics 365 for Customer Engagement apps version 9.x (on-premises)

New for Customer Engagement in Dynamics 365 for Customer Engagement apps version 9.0, you can use new security enhancements to better secure the Dynamics 365 for Customer Engagement apps.

Important

These security enhancements are also available for:

  • Microsoft Dynamics CRM 2016 (on-premises, version 8.2)
    The feature is available by contacting support.
  • Microsoft Dynamics CRM 2016 (on-premises, version 8.1)
    The feature is available by contacting support.
  • Microsoft Dynamics CRM 2015 (on-premises)
    The feature is available by contacting support.

For more information on these versions, see Security enhancements: User session and access management

Tip

Video symbol Check out the following video: Security Enhancements: User session management.

User session timeout

By default, Dynamics 365 for Customer Engagement apps sets a user session timeout of 24 hours. A user is not required to log in with their credentials for up to 24 hours regardless of whether the user was active or inactive.

You can change this behavior.

  • To enforce users to re-authenticate after a pre-determined period of time, admins can set a session timeout for their individual Dynamics 365 for Customer Engagement instances. Users can only remain signed in the application for the duration of session. The application signs out the user when the session expires. Users need to sign-in with their credentials to return to Dynamics 365 for Customer Engagement apps.

Note

User session timeout is not enforced in the following:

  1. Dynamics 365 for Outlook

  2. Dynamics 365 for phones and Dynamics 365 for tablets
  3. Unified Service Desk client using WPF browser (Internet Explorer is supported)
  4. Live Assist (Chat)

Configure session timeout

  1. In Dynamics 365 for Customer Engagement apps, choose Settings > Administration > System Settings > General tab.
  2. Under Set session timeout, set the values to apply to all your users.

Note

Default values are:

  • Maximum Session Length: 1440 minutes
  • Minimum Session Length: 60 minutes
  • How long before session expires before showing timeout warning: 20 minutes

Inactivity timeout

By default, Dynamics 365 for Customer Engagement apps does not enforce an inactivity session timeout. A user can remain logged in the application until the session timeout expires. You can change this behavior.

  • To enforce users to automatically signed out after a pre-determined period of inactivity, admins can set an inactivity timeout period for each of their Dynamics 365 for Customer Engagement instances. The application signs out the user when the inactivity session expires.

Note

Inactivity session timeout is not enforced in the following:

  1. Dynamics 365 for Outlook

  2. Dynamics 365 for phones and Dynamics 365 for tablets
  3. Unified Service Desk client using WPF browser (Internet Explorer is supported)
  4. Live Assist (Chat)

To enforce the inactivity session timeout for Web Resources, Web Resources need to include the ClientGlobalContext.js.aspx file in their solution.

The Dynamics 365 for Customer Engagement apps portal has its own settings to manage its session timeout and inactivity session timeout independent of these system settings.

Configure inactivity timeout

  1. In Dynamics 365 for Customer Engagement apps, choose Settings > Administration > System Settings > General tab.
  2. Under Set inactivity timeout, set the values to apply to all your users.

Note

Default values are:

  • Minimum Duration of Inactivity: 5 minutes
  • Maximum Duration of Inactivity: less than Maximum Session length or 1440 minutes

Access management

Dynamics 365 for Customer Engagement apps uses Azure Active Directory as the identity provider. To secure the user’s access to Dynamics 365 for Customer Engagement apps, the following were implemented:

  • To enforce users to re-authenticate, users are required to sign in with their credentials after they signed out within the application.
  • To prevent users from sharing credentials to access Dynamics 365 for Customer Engagement apps, the user access token is validated to ensure that the user who was given access by the identity provider is the same user who is accessing Dynamics 365 for Customer Engagement apps.

Steps for enabling security enhancements for Dynamics 365 for Customer Engagement apps (on-premises) deployments

These security enhancements are shipped disabled by default. Administrators can enable these enhancements when using one of the supported Dynamics 365 for Customer Engagement apps (on-premises) builds listed below.

Note

This applies to customers with the following versions of Dynamics 365 for Customer Engagement:

  • Microsoft Dynamics CRM 2016 (on-premises, version 8.2)
    The feature is included in this update.
  • Microsoft Dynamics CRM 2016 (on-premises, version 8.1)
    The feature is available by contacting support.
  • Microsoft Dynamics CRM 2015 (on-premises)
    The feature is available by contacting support.

Requirement These security enhancement features require claims-based authentication for user authentication. You can configure claims-based authentication in one of two ways:

To obtain SDK sample code (for reference, not required to configure and enable session timeout):

  1. Access your Dynamics 365 for Customer Engagement server using your administrator account.
  2. Open a browser session and download the Dynamics 365 for Customer Engagement apps Software Development Kit (SDK).
  3. Select and run MicrosoftDynamics365SDK.exe. This will extract the download and create an SDK folder on your Dynamics 365 for Customer Engagement server.
  4. Open a PowerShell command prompt.
  5. Navigate to the downloaded SDK folder.
  6. Open the SampleCode\PS folder.

After updating to a supported on-premises version, follow the steps below to enable security enhancements.

User session timeout

System admins can now force users to re-authenticate after a set period. You can set an active session timeout for each of your Dynamics 365 for Customer Engagement instances. Users can only remain signed in to the application for the duration of the session. Once the session expires, they’ll need to sign in again with their credentials. System admins can also require sign in for users after a period of inactivity. You can set an inactivity timeout for each of your instances. The helps prevent unauthorized access by a malicious user from an unattended device.

Enable user session timeout

  1. Enable session timeout:

    SetAdvancedSettings.ps1 -ConfigurationEntityName ServerSettings -SettingName AllowCustomSessionDuration -SettingValue true
    
  2. Enable inactivity timeout:

    SetAdvancedSettings.ps1 -ConfigurationEntityName ServerSettings -SettingName AllowCustomInactivityDuration -SettingValue true
    

Access token management

To better protect user access and data privacy in Dynamics 365 for Customer Engagement, when a user signs out in the web client and needs to return to the application, they will need to enter their credentials again in all open browser sessions. Dynamics 365 for Customer Engagement apps ensures that the sign-in token was originally generated for the current browser and computer.

Enable access token management

To enable for all organizations by default, copy and run this command in PowerShell:

SetAdvancedSettings.ps1 -ConfigurationEntityName ServerSettings -SettingName WSFedNonceCookieEnabled -SettingValue true

Sample:

SetAdvancedSettings.ps1

-OR-

To enable for a single organization, copy and run this command in PowerShell:

SetAdvancedSettings.ps1 -ConfigurationEntityName Organization -SettingName WSFedNonceCookieEnabled -SettingValue true -Id <Your organization ID GUID>

To get [Your organization ID GUID], open PowerShell, and run the following:

Add-PSSnapin Microsoft.Crm.PowerShell 
Get-CrmOrganization

Sample:

Example Organization ID

For more information, see Get-CrmOrganization for details.