Layer7 API Management

  • 1.  Context client linked to OAuth token ?

    Posted Jun 09, 2016 04:03 AM

    Hi,

     

    It is possible to retrieve a custom value from a OAuth 2.0 token in a gateway ? The functional use case is to store the unique ID of a client and link it to the OAuth token generated. Then we could retreive the client's ID with the OAuth token.

    Do you know if it is possible and which assertion does that ?

     

    Regards,

    Thanks



  • 2.  Re: Context client linked to OAuth token ?
    Best Answer

    Broadcom Employee
    Posted Jun 09, 2016 09:55 AM

    Hi FrederickMiszewski,

     

    You may be able to achieve the desired results using the custom field that was introduced in OTK 3.4.

    (ref: https://docops.ca.com/ca-api-management-oauth-toolkit/3-4/using-the-oauth-manager).

     

    For example, if you want to store an ID number and full user name along with the client you would add something like this

    { "ID": "7391","name": "John Doe"} to the custom  field.

     

    When you receive the token this information will then be accessible via the Tokenstore endpoint: (Tokenstore API - CA API Management OAuth Toolkit - 3.4 - CA Technologies Documentation)

     

    https://test-sgg:8443/oauth/tokenstore/get?token=6fe0197b-41d3-43aa-99a1-e02fcf7fb5d5

     

    would return the following (just an excerpt for brevity)

     

         <custom>{

        "otk": {"client_type": "confidential","grant_type": "authorization_code"},

        "portal": {},

        "mag": {},

        "clientkey": { "ID": "7391","name": "John Doe"}

      }</custom>