1
votes

I am developing windows 8.1 store application. The application integrate the " Office 365 API client libraries" by the way of this link told :http://blogs.office.com/2014/08/05/office-365-api-tool-visual-studio-2013-summer-update/

according to link above, I create a Office 365 free trail account, default Office 365 account will have a admin tenant, and successes to run this the demo with this admin tenant : http://code.msdn.microsoft.com/windowsapps/Office-365-APIs-Get-41eebcdf

Then I create other tenant in my office 365 manage center. But when i re-run the demo and log in with the new tenant, I was refused with the

error info: "Sorry, but we’re having trouble signing you in. We received a bad request." and

error code : "AADSTS50020: Calling principal cannot consent due to lack of permissions. "

So How to login office365 by my store app for different accounts ?

1

1 Answers

1
votes

I have some advice.

According to this link , I installed "Windows Azure AD PowerShell" on my PC and used this PowerShell command "Set-MsolCompanySettings -UsersPermissionToUserConsentToAppEnabled:$true" to set the consent for the tenant in Windows Azure AD. Then I re-registered my application with a tenant without admin role like this.

So the problem seems to be partly resolved. I can log in Office 365 programmatically through a different tenant. :)