<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
System Status
Announcements
Announcements
Search
Search
Select Language
0D5WR00002OaIPb0ANOkta Classic EngineAuthenticationAnswered2026-11-24T07:28:55.000Z2026-11-05T08:26:05.000Z2026-11-24T07:28:55.000Z

kanakos.23654 (Customer) asked a question.

Question Regarding Office 365 License Assignment and Usage Location

Dear Okta Community Team,

We are currently integrating Office 365 with Okta.

After assigning an Office 365 license in Okta, we encountered the following error:

"errorMessage="License assignment cannot be done for user with invalid usage location."

 

Based on our investigation, we understand that this error occurs when the Usage Location attribute in Microsoft Entra ID is either not configured or contains an invalid value.

Currently, we have not configured a mapping to automatically populate Usage Location from the Okta user profile to Microsoft Office 365. Therefore, the Usage Location field is blank for these users.

 

However, after the error occurred, we attempted to assign the Office 365 license again manually through Okta, and the license was assigned successfully without any error.

Could you please clarify why the license can be assigned successfully on the second attempt even though the Usage Location has not been configured?

 

Additionally, we have noticed that some users can be assigned an Office 365 license without encountering this error. Could you please explain why license assignment succeeds for some users even when Usage Location is not mapped from Okta to Office 365?

 

Thank you in advance for your assistance.


  • Paul S. (Okta, Inc.)

    Hello @kanakos.23654 (Customer)​ Thank you for posting on our Community page!

     

    You are asking why the Office 365 license assignment in Okta succeeded on a second attempt without a Usage Location configured, and why some users are assigned licenses without this error when Usage Location is not mapped from Okta to Office 365.

     

    Summary: The error occurs only when the user object in Microsoft Entra ID has no valid Usage Location at the moment the license is requested, so the outcome depends on each user's Entra ID state at the time of assignment.

     

    Root Cause: Microsoft Entra ID requires a valid two-letter country code in the usageLocation

    property before it can assign a license to a user. Okta does not populate this property unless an attribute mapping is configured. A license request that runs while usageLocation is empty fails with the "invalid usage location" error. The same request succeeds once a valid value exists on the user object. Any change to that user object in Entra ID between the two attempts explains the difference. Possible sources include a default Usage Location applied by a Microsoft 365 administrator, a value set by PowerShell or Microsoft Graph, or a value written by another provisioning or sync process.

    Users who succeed without the error most likely already have a valid usageLocation

    in Entra ID. This value may have been set manually, through an earlier process, or when the account was created in the Microsoft 365 admin center. Users with a blank value fail until the value is set.

     

    Solution: Populate Usage Location from Okta so that every provisioned user has a valid value before the license is requested.

    1. Confirm that each Okta user profile contains a country attribute that stores a two-letter ISO 3166-1 alpha-2 code, such as US, GB, or DE.
    2. Navigate to the Microsoft Office 365 application in the Okta Admin Console, then open Provisioning → To App → Edit the Okta-to-Office 365 attribute mappings in the Profile Editor.
    3. Add a mapping that sets the Office 365 usageLocation attribute from the Okta country attribute, and set the mapping to update on each user push.
    4. Save the mapping, then Reassign the Office 365 license to affected users, or re-run the provisioning task for the failed users from the Tasks page.
    5. Verify in Microsoft Entra ID that usageLocation is populated for those users before relying on the mapping.

    Manage all license assignments for this integration from the Okta side only. Licenses also changed directly in Microsoft 365 can be overwritten by later Okta pushes, which can make assignment results appear inconsistent between users.

     

    Thank you for reaching out to our Community and have a great day!

    --

    Help others in the community by liking or hitting Select as Best if this response helped you.

    Expand Post
    Selected as Best
  • Paul S. (Okta, Inc.)

    Hello @kanakos.23654 (Customer)​ Thank you for posting on our Community page!

     

    You are asking why the Office 365 license assignment in Okta succeeded on a second attempt without a Usage Location configured, and why some users are assigned licenses without this error when Usage Location is not mapped from Okta to Office 365.

     

    Summary: The error occurs only when the user object in Microsoft Entra ID has no valid Usage Location at the moment the license is requested, so the outcome depends on each user's Entra ID state at the time of assignment.

     

    Root Cause: Microsoft Entra ID requires a valid two-letter country code in the usageLocation

    property before it can assign a license to a user. Okta does not populate this property unless an attribute mapping is configured. A license request that runs while usageLocation is empty fails with the "invalid usage location" error. The same request succeeds once a valid value exists on the user object. Any change to that user object in Entra ID between the two attempts explains the difference. Possible sources include a default Usage Location applied by a Microsoft 365 administrator, a value set by PowerShell or Microsoft Graph, or a value written by another provisioning or sync process.

    Users who succeed without the error most likely already have a valid usageLocation

    in Entra ID. This value may have been set manually, through an earlier process, or when the account was created in the Microsoft 365 admin center. Users with a blank value fail until the value is set.

     

    Solution: Populate Usage Location from Okta so that every provisioned user has a valid value before the license is requested.

    1. Confirm that each Okta user profile contains a country attribute that stores a two-letter ISO 3166-1 alpha-2 code, such as US, GB, or DE.
    2. Navigate to the Microsoft Office 365 application in the Okta Admin Console, then open Provisioning → To App → Edit the Okta-to-Office 365 attribute mappings in the Profile Editor.
    3. Add a mapping that sets the Office 365 usageLocation attribute from the Okta country attribute, and set the mapping to update on each user push.
    4. Save the mapping, then Reassign the Office 365 license to affected users, or re-run the provisioning task for the failed users from the Tasks page.
    5. Verify in Microsoft Entra ID that usageLocation is populated for those users before relying on the mapping.

    Manage all license assignments for this integration from the Okta side only. Licenses also changed directly in Microsoft 365 can be overwritten by later Okta pushes, which can make assignment results appear inconsistent between users.

     

    Thank you for reaching out to our Community and have a great day!

    --

    Help others in the community by liking or hitting Select as Best if this response helped you.

    Expand Post
    Selected as Best
  • kanakos.23654 (Customer)

    I'm so sorry , i couldn't respond you so long time.

    Thank you for your ​assistance, it was very helpful!!

Loading
Question Regarding Office 365 License Assignment and Usage Location
Okta Support Agent (Beta)

Terms of Service

Hello! I'm the Okta Support Agent (Beta), your go-to resource for questions about Okta products. Please remember for your security and privacy, do not share any Personally Identifiable Information (PII) such as passwords, IP addresses, or other details with me.

Okta Privacy Policy and Terms of Service apply