Provision users to Office 365

You can create, update, deprovision, and sync users in Office 365 from your Okta org. You can import users from different source directories into Okta and provision them in Office 365 using profile mappings.

Before you begin

  • Complete Configure Single Sign-On for Office 365.
  • Disable the Microsoft MFA for the Office 365 admin account that you're using for WS-Federation. If the MFA is enabled, it can break provisioning and single sign-on setups in Okta.
  • Bring users into Okta: You can import users from a directory such as Active Directory (AD) or an app such as Salesforce. Currently, Okta doesn't support imports that take longer than two hours to complete. Contact Support if you have this type of import. You can also create users directly in Okta. See the following for more information:

  • Decide the type of provisioning, depending on your provisioning needs. See Provisioning options for Office 365.

  • Ensure you have a Global administrator account in Microsoft and an App administrator account in Okta tenant.

Start this procedure

To provision users in Office 365, you need to perform the following tasks in order:

  1. Set up Okta to Office 365 provisioning

  2. Map profile attributes Okta to Office 365

  3. Test provisioning

Set up Okta to Office 365 provisioning

You can automate provisioning tasks by enabling API integration, obtaining admin consent for user import and provisioning, and configuring settings for user lifecycle stages.

Enable API integration

Office 365 requires your consent to authenticate against the Microsoft API. This allows Okta to enable provisioning in Office 365 applications.

  1. Go to Office 365ProvisioningIntegrationConfigure API Integration.
  2. Check Enable API Integration.
  3. Click Authenticate with Microsoft Office 365 to provide consent. You're redirected to the Microsoft Azure login page.

  4. Click Accept. Upon accepting the scopes in the Microsoft Azure portal, you're redirected back to Okta.

Select provisioning type and settings

The provisioning options depend on the provisioning type that you select. Profile Sync is selected by default.

  1. Go to Office 365ProvisioningTo AppEdit.
  2. Select Office 365 Provisioning Type.

    You can change the provisioning type from Profile Sync to Licenses & Role Management, Universal, or User Sync. See Provisioning options for Office 365.

    For Universal Sync only: Select Send full profile, contacts, and conference rooms from these AD instances if you want to sync Active Directory groups and resources.

    Info

    A service account is created in Azure Active Directory with the username format svc_OKTA_sync_{appId}. This only applies to User Sync and Universal Sync provisioning types. Don't delete or modify this account.

    The service account shouldn't use MFA and must be excluded from all Azure Active Directory conditional access policies.

  3. Enable or disable other provisioning settings. See Get started with Office 365 provisioning and deprovisioning.
  4. Click Save.
Info

Each user provisioned for Office 365 has an attribute, StsRefreshTokensValidFrom, which is a date that invalidates existing user sessions and refresh tokens when users change their password, requiring the user to sign in to their apps again. This attribute is automatically calculated and populated based on the provisioning type.

  • License Only or Profile Sync: The StsRefreshTokensValidFrom attribute is set to the current date and time when the user changes their password in Okta.

  • User Sync or Universal Sync: If the user is linked from Active Directory (AD), the StsRefreshTokensValidFrom attribute is set to the pwdLastSet attribute in AD. For all other users, the StsRefreshTokensValidFrom attribute is set to the current date and time when the user changes their password in Okta.

Map profile attributes Okta to Office 365

Depending on where your users are sourced from, the username format can vary. For users to successfully sign in to Office 365, their username for Office 365 must be in an email address format for the domain you're federating (username@yourfederated.domain).

Important Note

You must remap attributes whenever you make any changes to provisioning settings.

Map username unchanged

If your users already have their username in an email address format for the domain you're federating (username@yourfederated.domain) format, you can map the email without reformatting.

  1. Go to Office 365 Sign onEdit.
  2. In Credentials DetailsApplication username format, select Email.
  3. Click Save.

Map custom username

If your users are sourced from different directories or apps, their username format may vary. You can use the Okta Expression Language to customize the username that is passed on to Office 365.

  1. Go to Office 365 Sign onEdit.
  2. In Credentials DetailsApplication username format, select Custom.

    Enter this expression in the provided text box:

    String.substringBefore(user.email, "@") + "@yourfederated.domain"
  3. Replace yourfederated.domain with the domain that you're federating.
  4. Click Save.

Map email address

If your users' email addresses don't reside in the domain you're federating, you can use the Okta Expression Language to customize the email address that's passed to Office 365.

Prerequisite

Provisioning type should be selected to User Sync or Universal Sync. See Provisioning options for Office 365.

  1. Go to DirectoryProfile EditorAppsMicrosoft Office 365 MappingsOkta User to Microsoft Office 365.
  2. In the source.email field, enter the expression:
    String.substringBefore(user.email, "@") + "@yourfederated.domain"
  3. Replace yourfederated.domain with the domain that you're federating.
  4. Enter an Okta user in the Preview box to check the result of the mapping.
  5. The resulting email address should match the Office 365 email address for the user.
  6. Exit Preview and save mappings.
  7. Click Apply Updates Now.

Test provisioning

Ensure you have correctly configured provisioning by assigning Office 365 to test users in Okta and verifying they appear in your Microsoft tenant. Be sure that you've selected the Create Users option in Provisioning.

In Okta:

  1. Open the Assignment tab of the Microsoft Office 365 app.
  2. Click Assign.
  3. Assign appropriate Office 365 licenses to test users.
  4. Click Done.

In the Microsoft Admin center:

  1. Open the list of Active Users.
  2. Ensure that all test users appear in the list with appropriate licenses.

In Okta:

  1. Log into Okta as a test user.
  2. Ensure that all Office 365 apps appear on the user dashboard.
Info

If you've selected the User Sync or Universal Sync provisioning type, all users appear as Synced with Active Directory in the Office 365 tenant, irrespective of where their profile is sourced. However, individual users are still sourced from their respective directories.

Next step

Assign Office 365 to users and groups