Hello,
The api was working before and not I get this error while trying to get an access token.
First I reach to this URL
https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=<CLIENT ID>&response_type=code&scope=offline_access openid https://outlook.office.com/User.Read&redirect_uri=<MY RETURN URI>&state=office365
Then I get the token and make this call in order to get the access token (POST request):
URL
https://login.microsoftonline.com/common/oauth2/v2.0/token
Array
(
[client_id] => <MY CLIENT ID>
[client_secret] => <MY SECRET ID>
[code] => <CODE FROM PREV REQUEST>
[grant_type] => authorization_code
[scope] => offline_access openid https://outlook.office.com/User.Read
)
Then I get this response:
Array
(
[error] => invalid_grant
[error_description] => AADSTS700009: 'redirect_uri' must be provided when presenting an authorization code requested with a 'redirect_uri'.
Trace ID: <trace_id>
Correlation ID: <correlation_id>
Timestamp: 2021-01-04 18:20:59Z
[error_codes] => Array
(
[0] => 700009
)
[timestamp] => 2021-01-04 18:20:59Z
[trace_id] => <trace_id>
[correlation_id] => <correlation_id>
)
The URL in my application account is identical to the <MY RETURN URI>.
What can be the issue?
Thanks.
