Share via

error: "Tenant does not have a SPO license" for personal account.

Himanshu Garg 46 Reputation points Microsoft Employee
Nov 4, 2022, 10:24 AM

Hi, I am trying to read drive items for my personal account but getting this error in postman via https://graph.microsoft.com/v1.0/me/drive/recent.

   json  
   {  
       "error": {  
           "code": "BadRequest",  
           "message": "Tenant does not have a SPO license.",  
           "innerError": {  
               "date": "2022-11-04T10:21:56",  
               "request-id": "26a9833b-92c2-49b5-9954-149432164c0a",  
               "client-request-id": "26a9833b-92c2-49b5-9954-149432164c0a"  
           }  
       }  
   }  

I can access this url via Graph explorer. I have configured the app on azure via my personal account.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,260 questions
0 comments No comments
{count} vote

Accepted answer
  1. CarlZhao-MSFT 45,761 Reputation points
    Nov 4, 2022, 11:36 AM

    Hi @Himanshu Garg

    This is because you obtained a tenant-wide token, change /{tenant id} to /common when requesting the token to skip tenant-level logins.

    https://login.microsoftonline.com/common/oauth2/v2.0/authorize?  
    client_id={client id}  
    &response_type=code  
    &redirect_uri={redirect url}  
    &response_mode=query  
    &scope=https://graph.microsoft.com/.default  
    &state=12345  
    

    Also, make sure your app is registered as: Accounts in any organizational directory (Any Azure AD directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox).

    257263-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    2 people found this answer helpful.

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.