Provision users to Office 365

You can create, update, and deprovision 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

Start this procedure

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

Set up Okta to Office 365 provisioning

You can automate provisioning tasks by enabling API integration and configuring settings for different user lifecycle stages.

Enable API integration

Office 365 requires a token to authenticate against the Microsoft API. This allows Okta to implement provisioning in Office 365.

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

    1. Log in to your Microsoft Azure account.

    2. Read and accept the requested permissions.

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

  4. Enter your Office 365 Global Administrator credentials.
  5. To import groups now, check Import Groups.

    You can import groups later after finishing provisioning. See Skip importing groups during Office 365 user provisioning.

  6. Click Test API Credentials.
  7. Save the credentials once they're verified successfully.

Select provisioning type and settings

These options depend on the provisioning type you select.

  1. Go to Office 365ProvisioningTo AppEdit.
  2. Select Office 365 Provisioning Type. 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.

  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 365Sign 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. Enter an Okta user in the Preview box to check the result of the mapping.
  5. The resulting username should match the Office 365 username for the user.
  6. 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 EditorMicrosoft Office 365 MappingsOkta to Microsoft Office 365.
  2. In the source.email field, enter this 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