Tenant does not have a SPO license.

Anonymous
2024-02-07T06:27:18.1433333+00:00

Hi all, I am getting this error: Tenant does not have a SPO license. while using this API: https://graph.microsoft.com/v1.0/users?$select=ageGroup,city,birthday

To get an access token with grant-type client credentials I am using this API: https://login.microsoftonline.com/{tenant-id}/oauth2/token

Questions:

  1. Can you please provide steps for creating credentials that do not give this error?
  2. Which license do we need to provide for this issue and what are the steps for it?
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
Microsoft 365 and Office | SharePoint | For business | Windows
Microsoft Security | Microsoft Entra | Microsoft Entra ID
Microsoft Security | Microsoft Authenticator
Microsoft Security | Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. Harpreet Singh Matharoo 8,401 Reputation points Microsoft Employee Moderator
    2024-02-07T06:54:02.9766667+00:00

    Hello @Vinay Sharma ,

    Thank you for reaching out to Microsoft QnA platform. The error “Tenant does not have a SPO license” typically occurs when the tenant you’re trying to access does not have a SharePoint Online (SPO) license.

    Here are the steps to resolve this issue:

    1. Assign a SharePoint Online License: You need to assign a SharePoint Online license to the user. You can do this by logging into the Office 365 admin center, selecting the user, and checking the “SharePoint Online” box in the “Manage Product Licenses” section.
    2. Use a Work/School Account: Ensure you’re using a work or school account, not a personal Microsoft account. The /tenant id or /contoso.onmicrosoft.com endpoint only allows users with work/school accounts of a specific Azure AD tenant to log in to the application.

    This issue seems to have been discussed on other forums as well and below links might be helpful:

    I hope this answer helps to resolve your issue. Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.