Tenant does not have a SPO license.

Vinay Sharma 60 Reputation points
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
Microsoft 365
Formerly Office 365, is a line of subscription services offered by Microsoft which adds to and includes the Microsoft Office product line.
5,771 questions
Microsoft Authenticator
Microsoft Authenticator
A Microsoft app for iOS and Android devices that enables authentication with two-factor verification, phone sign-in, and code generation.
8,387 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,303 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
11,230 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,733 questions
0 comments No comments
{count} vote

Accepted answer
  1. Harpreet Singh Matharoo 8,356 Reputation points Microsoft Employee
    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.