How to get the data from a Oauth2 rew


This topic has 3 replies, 2 voices, and was last updated 2 years, 2 months ago by Jatinder Singh.

  • Author
  • #28051

    In a Oauth2 client credential flow, I use a curl command and get a token from the server. My command like this:

    curl –request POST –data “grant_type=client_credentials&client_id=le-test-client&client_secret=password&scope=read” “”

    Then I add a parameter like this:

    curl –request POST –data “grant_type=client_credentials&client_id=le-test-client&client_secret=password&scope=profile&uid=user.1” “”

    And now I want to add the uid inside the JWT token, I stuck on how to extract the data from my request in the OAuth2 Access Token Modification Script. In the defined variables of this script I don’t find request, and have no idea how to create a variable that refer to my request.

     Jatinder Singh


    You can define a custom scope validator that extends from OpenAMScopeValidator and add additional claims to your Access Token in the additionalDataToReturnFromTokenEndpoint method.

    Hope this helps!


    Yes, I think it’s a good way to solve my problem, thanks for your help

    Best & Thanks

     Jatinder Singh

    Np :) Glad it helped!

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

©2022 ForgeRock - we provide an identity and access platform to secure every online relationship for the enterprise market, educational sector and even entire countries. Click to view our privacy policy and terms of use.

Log in with your credentials

Forgot your details?