Layer7 API Management

 View Only
Expand all | Collapse all

Need Custom Implementation of oauth token

  • 1.  Need Custom Implementation of oauth token

    Posted Jan 25, 2021 01:52 PM
    Need to call /oauth/token with only Grant_Type & Client_ID.  Client_Secret should not be used. How to customize oauth policy for a particular  API thus only Grant_Type & Client_ID can be used to generate the Token not the Client_Secret.

    Please give me very low level explanation to implement this ASAP.


    Regards,
    Sanjeev


  • 2.  RE: Need Custom Implementation of oauth token

    Broadcom Employee
    Posted Jan 26, 2021 10:55 AM
    Hello, 

    The client need to be registered as a public client to issue token without specifying  client_secret.



  • 3.  RE: Need Custom Implementation of oauth token

    Posted Jan 26, 2021 01:17 PM
    Hi Barry,
                    Thanks for your rely . Can you kindly come with the details step where & how need to implement  this?  Whether it will impact the other API also. Kindly come with details . I new with the Layer 7.

    Regards,
    Sanjeev


  • 4.  RE: Need Custom Implementation of oauth token

    Broadcom Employee
    Posted Jan 26, 2021 04:16 PM
    Hello

    You can find details regarding registering clients using the  Oauth manager here:
    https://techdocs.broadcom.com/us/en/ca-enterprise-software/layer7-api-management/api-management-oauth-toolkit/4-4/registering-clients-with-the-oauth-manager.html

    when registering specify client type as public only public clients can generate  tokens without specifying client secret.


  • 5.  RE: Need Custom Implementation of oauth token

    Posted Jan 27, 2021 09:07 AM
    Hi Barry,
                   Got  it. Now if I want to restrict it for a particular grant_type for this . For a perticular grant_type the oauth call will not process the how to implement it for /oauth/token? please assist.


    Regards,
    Sanjeev


  • 6.  RE: Need Custom Implementation of oauth token

    Posted Jan 29, 2021 10:14 PM
    Hii,
          Is there any one who can help here. Need to call /oauth/token with only Grant_Type & Client_ID.  Client_Secret should not be used & for a perticular grant_type the request will not proceed further.

    Regards,
    Sanjeev



  • 7.  RE: Need Custom Implementation of oauth token

    Broadcom Employee
    Posted Feb 01, 2021 11:35 AM
    Edited by Barry Stern Feb 01, 2021 11:35 AM
    Hi Sanjeev,

    As discussed above only Public clients can make call without specifying the client_secret. If you further want to restrict the grant_types a client is allowed to call you can do this using the OTK openid registration

    https://techdocs.broadcom.com/us/en/ca-enterprise-software/layer7-api-management/api-management-oauth-toolkit/4-4/openid-connect-implementation/dynamic-registration.html

    When you register the client in oauth/manager make sure you include the openid scope  and you can specify the list of grant_types the client is allowed to call in the openid Json .openid_registration.response.grant_types


    //Screenshot of a client_key specifying grant_types this client is allow to call.







  • 8.  RE: Need Custom Implementation of oauth token

    Posted Feb 01, 2021 01:39 PM
    Hi Barry,
                    Thanks for your help. I want to restrict a particular grant_type only (restrict_grantType) & all other grant_type will be allowed then what to mention in the custom_field?  Can you please give me the custom_field you showed in a file as attachments to me .


    Regards,
    Sanjeev


  • 9.  RE: Need Custom Implementation of oauth token

    Broadcom Employee
    Posted Feb 01, 2021 02:23 PM
    Edited by Barry Stern Feb 01, 2021 02:23 PM
    Hello,

    Can you supply more on your requirement of why you need this?  Out of the box all clients are allowed to call for any enabled grant_type. or you can specify grant_types allowed for each client.

    Are you looking to restrict all clients or just one specific client from calling a specific grant_type?
    Which grant_type are you looking to restrict? 

    Once I understand exactly what you are looking for I can provide better guidance. 

    Thanks
    Barry


  • 10.  RE: Need Custom Implementation of oauth token

    Posted Feb 02, 2021 02:54 PM
    Hii Barry,
                    PFB my requirement in details:
    1) For a particular grant type "restrict_grantType" there will be no client secret to generate the token.
    2) For all other grant_type there will be as it is the  token generation.

    Regards,
    Sanjeev


  • 11.  RE: Need Custom Implementation of oauth token

    Posted Feb 06, 2021 02:35 PM
    Hi Barry,
                 I clear the requirement . Please provide me the solution . Provide the fields also  as an attachments .

    Regards,
    Sanjeev


  • 12.  RE: Need Custom Implementation of oauth token

    Broadcom Employee
    Posted Feb 08, 2021 01:45 PM
    Hello Sanjeev,

    I have provided steps to accomplish the 2 requirements you specified previously.

    1) For a particular grant type "restrict_grantType" there will be no client secret to generate the token.
    This is provided  by registering a Public client via the Oauth manager and defining the client key with scope including openid and then for the custom JSON field that is generated when creating the 
    client set the value for element .openid_registration.response.grant_types to be "restrict_grantType" .  

    2) For all other grant_type there will be as it is the  token generation.
    Nothing else needs to be done all other confidential clients can call any configure grant_type as usual.


  • 13.  RE: Need Custom Implementation of oauth token

    Posted Feb 08, 2021 01:58 PM
    Hii Barry, 
                   Kindly provide me the custom field as an attachments. 

    Regards, 
    Sanjeev


  • 14.  RE: Need Custom Implementation of oauth token

    Broadcom Employee
    Posted Feb 08, 2021 05:03 PM
    Hello,

    there is nothing  to supply, the JSON will be generated as part of the client_key when you create the client.