question

78669366 avatar image
0 Votes"
78669366 asked azure-cxp-api edited

Graph api user authentication failing

Hi

I am testing out the GraphTutorial app (https://github.com/microsoftgraph/msgraph-training-dotnet-core/tree/main/demo).

I run the app, go to https://microsoft.com/devicelogin, enter the provided code, sign in with a user login and I get the page that says 'You have signed in to the My App application on your device. You may now close this window'.

Next comes the following statement;

     return await graphClient.Me
                     .Request()
                     .Select(u => new{
                         u.DisplayName,
                         u.MailboxSettings
                     })
                     .GetAsync();

and it gives me the 'Access is denied. Check credentials and try again' exception. I have tried with two different users with one being global admin but no luck.

I have given the following API permissions under Microsoft Graph;

Calendars.Read Delegated
Calendars.Read Application
Calendars.Read.Shared Delegated
Directory.Read.All Delegated
Directory.Read.All Application
openid Delegated
profile Delegated
User.Read Delegated

What am I missing?

Thanks

Regards


azure-active-directorymicrosoft-graph-calendar
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

KalyanChanumolu-MSFT avatar image
0 Votes"
KalyanChanumolu-MSFT answered

@78669366 Thank you for reaching out.

Please give "MailboxSettings.Read" permissions and it should work.


If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.