0

I am using the following project: https://github.com/OfficeDev/O365-ASPNETMVC-Start

I set the configurations as requested in the documentation but I am receiving an error after sign in.

Cause   Action
AdalException   This exception is thrown when either you have a stale O365 access token that can cause authentication errors, or you attempted to access a resource that you don't have permissions to access.

Make sure the app is configured with the correct service permissions in the Services Manager menu. If any of these permissions are not configured, or configured incorrectly, some parts of the app may throw an error. For example  Right click the project, select Connected Service..., and ensure the following permissions are set for this app:

(Calendar) – Have full access to users’ calendar and Read users' calendar
(Contacts) – Have full access to users’ contacts and Read users' contacts
(Mail) - Send mail as a user, Read and write access to users' mail, and Read users' mail
(Users and Groups) – Enable sign-on and read users’ profiles.

The permissions are set correctly:

enter image description here

How can I solve this problem?

User05
  • 121
  • 4
  • 10

2 Answers2

0

You are missing the Send permission under the Mail API.

Jason Johnston
  • 17,194
  • 2
  • 20
  • 34
  • Thanks for your reply. I tried your suggestion but still it is showing the same error. – User05 Jul 28 '15 at 17:22
  • Where is the issue occurring? I also see that My Files doesn't have the Read permission. Which also means that the error page needs an update to state that the Files permissions are needed. Since this has to do with a specific sample, please [open an issue](https://github.com/OfficeDev/O365-ASPNETMVC-Start/issues) on GitHub. – Michael Mainer Jul 28 '15 at 18:29
  • it is occurring after the the user signs in and click on calendar/contacts/Email/My Files. yes I also changed the File permission but it's all in vain. I will open an issue. thanks – User05 Jul 28 '15 at 18:53
0

I fixed the problem...I was logging with the developers account without an assigned license. You have to create a new user and ensure that it has the Microsoft Office 365 Developer set as Assigned license.

If not this error would occur:

When making a request as an account that does not have a mailbox, you must specify the mailbox primary SMTP address for any distinguished folder Ids.
User05
  • 121
  • 4
  • 10