I am using the graph api to call the teams Api.
And before I call the api I wanna get the access token by restful API then
I followed the guidance
https://docs.microsoft.com/zh-cn/graph/auth-v2-user
to build an application on azure portal and want to login by oauth2.0
First I called the api below to get the code
https://login.microsoftonline.com/XXXXXXX/oauth2/v2.0/authorize?
client_id=XXXXXXXXX
&response_type=code
&redirect_uri=https://login.microsoftonline.com/common/oauth2/nativeclient
&response_mode=query
&scope=offline_access%20user.read%20mail.read%20Directory.ReadWrite.All%20Group.ReadWrite.All%20ChannelMessage.Read.All
&state=12345
After the code is returned by the redirect uri which I set on the conf,
I called the token api to get the login token.
https://login.microsoftonline.com/XXXXXX/oauth2/v2.0/token
But it always showed
{
"error": "invalid_grant",
"error_description": "AADSTS65001: The user or administrator has not consented to use the application with ID '0e1f447e-e88b-454c-9eab-05464f01de21' named 'multi-platform-sns-dev'. Send an interactive authorization request for this user and resource.\r\nTrace ID: 6b05624a-d852-4aa5-b4d6-6babadf02900\r\nCorrelation ID: 75f0d769-9b21-4148-95b3-2f640d86771e\r\nTimestamp: 2022-05-13 06:12:23Z",
"error_codes": [
65001
],
"timestamp": "2022-05-13 06:12:23Z",
"trace_id": "6b05624a-d852-4aa5-b4d6-6babadf02900",
"correlation_id": "75f0d769-9b21-4148-95b3-2f640d86771e",
"suberror": "consent_required"
}

