I found the problem, I was using an incorrect url.
For the case of Applications permissions we must use https://graph.microsoft.com/v1.0/users/{userId}/sendMail.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am having problems to send mails using Microsoft Graph.
I did the following:
This permissions was aproved by an admin.
var clientSecret = @"{My generated Secret in Azure}";
var clientId = @"{My Client Id}";
var tenantID = @"{My Tenant Id}";
IConfidentialClientApplication app= ConfidentialClientApplicationBuilder
.Create(clientId)
.WithTenantId(tenantID)
.WithClientSecret(clientSecret)
.Build();
result = await app.AcquireTokenForClient(scopes)
.ExecuteAsync();
{
"error": {
"code": "ErrorAccessDenied",
"message": "Access is denied. Check credentials and try again."
}
}
IS there some additional configuration or miss configuration I am doing?
These are the values of the token:
I found the problem, I was using an incorrect url.
For the case of Applications permissions we must use https://graph.microsoft.com/v1.0/users/{userId}/sendMail.