Query Parameter in Authorize url to be passed to custom claims provider

Mohamed Seamari 0 Reputation points
2024-12-09T08:51:29.2666667+00:00

Using the following sample: https://learn.microsoft.com/en-us/entra/identity-platform/custom-extension-tokenissuancestart-configuration?tabs=azure-portal%2Cexternal-tenant I succeeded in triggering an Azure Function on the TokenIssuanceStart event to add custom claims to both the identity and access token.

as the tenant I'm working on is an "External" tenant I have to use the following url to login and get a token: https://{domainName}.ciamlogin.com/{tenantId}/oauth2/v2.0/authorize?client_id={App_to_enrich_ID}&response_type=id_token&redirect_uri=https://jwt.ms&scope=openid&state=12345&nonce=12345

now on this same url I want to add my own query parameter to it and have it pass to the Azure Function.

for example if I go to the following url: https://{domainName}.ciamlogin.com/{tenantId}/oauth2/v2.0/authorize?client_id={App_to_enrich_ID}&response_type=id_token&redirect_uri=https://jwt.ms&scope=openid&state=12345&nonce=12345?myparam=hello

I want the query parameter myparam to go either to be passed to the azure function as a query parameter for example: https://myazurefunction.azurewebsites.net/api/CustomClaims?myparam=hello

or that the query parameter is added as data in the "onTokenIssuanceStartCalloutData" when the azure function is triggered

Microsoft Security Microsoft Entra Microsoft Entra External ID
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Akhilesh Vallamkonda 15,320 Reputation points Microsoft External Staff Moderator
    2024-12-10T09:38:46.6366667+00:00

    Hi @Mohamed Seamari

    Thank you for reaching Microsoft Q&A Forum!

    If I understand correctly you would like to add the custom parameter to your URL, you have registered the custom claim in Entra ID which involves setting up the token issuance event and specifying the endpoint of your Azure Function.
    The application developer needs to implement the Azure Function to handle the incoming requests and process the custom query parameters.
    I suggest you reach the application developer to achieve your ask.

    Hope this helps. Do let us know if you any further queries by responding in the comments section.
    Thanks,

    Akhilesh


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


  2. Nicholas Plant 0 Reputation points
    2025-03-16T19:24:42.4966667+00:00

    I have the same issue - did you find direct way of doing it. I haven't had time to test it yet but I think I have an indirect way to do it. I think you will first need to create a custom attribute in the entra directory. Then use onattributesubmit to push the value from your app into the entra directory, then do your ontokenissueancestart event and pass the newly populated custom user attribute as part of the request body. Then your custom claims provider will be able to use this attribute to apply whatever logic it needs to construct the custom claims.

    If you find a way to do it or find that my way works please update us.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.