i have an app services. i turned on the app service authentication using : azure active directory. i also already added the the application ID URI(from azure AD) in the Allowed Token Audiences.
here is the api that i used to generate the token.
POST /xxxxx/oauth2/v2.0/token/ HTTP/1.1 Host: login.microsoftonline.com client_id=xxxx&client_secret=xxxxx&grant_type=client_credentials&scope=https://graph.microsoft.com/.default
decoded token role.
"roles": [
"User.ReadWrite.All",
"Directory.Read.All",
"Mail.Read"
],
decoded header.
{
"typ": "JWT",
"nonce": "xx",
"alg": "RS256",
"x5t": "xx",
"kid": "xx"
}
however, when i tried to login into the app service using those token,it return an error (signature validation failed)
{ "code": 401, "message": "IDX10511: Signature validation failed. Keys tried: '[PII is hidden]'. \nkid: '[PII is hidden]'. \nExceptions caught:\n '[PII is hidden]'.\ntoken: '[PII is hidden]'." }
did i missed something?