A cloud-based identity and access management service for securing user authentication and resource access
Hello @Nitish Som,
If you are using the Client Credentials flow for your automation application, please ensure that you configure Application permissions (instead of Delegated permissions) under the API permissions blade.
I can see that you have added Microsoft Graph Delegated permissions for your application. Delegated permissions work as expected only when there is user interaction during authentication. However, if your application authenticates without any user interaction, you must use Application permissions, grant admin consent, and then test again.
If you are still receiving the same error even after adding Application permissions, please verify the URL being used in your authentication request. If you are calling the /adminconsent endpoint during authentication, it will continue to prompt for consent repeatedly—even if admin consent has already been granted.
To avoid this behavior, do not send authentication requests to the /adminconsent endpoint. Instead, redirect your request to the /authorize or /token endpoint, depending on the OAuth flow you are using.
Below is a sample admin consent URL:
https://login.microsoftonline.com/{tenant}/v2.0/adminconsent
?client_id=00001111-aaaa-2222-bbbb-3333cccc4444
&scope=https://graph.microsoft.com/Calendars.Read https://graph.microsoft.com/Mail.Send
&redirect_uri=http://localhost/myapp/permissions
&state=12345
Reference: https://learn.microsoft.com/en-us/entra/identity-platform/v2-admin-consent