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:
- 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.
- 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:
- https://learn.microsoft.com/en-us/answers/questions/1028852/message-tenant-does-not-have-a-spo-license-however
- https://stackoverflow.com/questions/46802055/tenant-does-not-have-a-spo-license
- https://github.com/microsoftgraph/msgraph-sdk-go/issues/394
- https://stackoverflow.com/questions/59159530/tenant-does-not-have-a-spo-license-when-using-microsoft-graph-api-with-applicati
- https://learn.microsoft.com/en-us/archive/msdn-technet-forums/24b6deab-60af-4501-99d6-0a6d2a83f076
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.