I am creating Bearer token from Azure AD using the following
URL - https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
Request Method - POST
Payload -
{
"client_id": "",
"client_secret": "",
"scope: "",
"grant_type": "client_credentials"
}
This is generating access token as expected.
My requirement is I want to pass an extra param when generating token like "testId" (dynamic value) along with client id, secret, scope & grant_type while creating token and fetch the testId value when validating or verifying the token.
I tried adding a custom claim in azure portal and fetched it when validating but the limitation here is that we need to hard-code the value in azure portal.
Do we have any other way to complete my requirement?
Any help is much appreciated.