microsoftgraph / msgraph-sdk-php

Microsoft Graph Library for PHP.
Other
578 stars 144 forks source link

Question about auth_code and authentication flow. #1453

Closed ElUtku closed 9 months ago

ElUtku commented 10 months ago

Hi, The auth_code is unique for each request, so if I want to ask for the user's email, I need a code and if I want to ask for the user's profile picture, I need another code. Every time I ask for a code, it is necessary for the user to authenticate on the Microsoft platform. I don't know if I'm doing something wrong or I don't understand the flow. I can also get the access_token but this is not useful to make calls to Microsoft graph because what I need is the code so I do not understand how to make calls to Microsoft if I need the user interaction.

For example, if i try: $scope = 'User.Read openid Files.Read offline_access Mail.Read'

$me = $graphServiceClient->me()->get()->wait(); $drive = $graphServiceClient->me()->drive()->get()->wait();

i get invalid_grant "The provided value for the 'code' parameter is not valid. The code has expired."...

Ndiritu commented 9 months ago

Closing as duplicate of https://github.com/microsoftgraph/msgraph-sdk-php/issues/1407