API Connect

 View Only
  • 1.  API Connect with third party OAuth Provider (RedHat SSO KeyCloak)

    Posted Sat October 14, 2023 09:30 AM
    Edited by Guo Jun Qiao Sat October 14, 2023 09:50 AM

    I am using API Connect 10.0.5. I have third part OAuth provider setup in RedHat SSO KeyCloak (version 22). In API Manager I configured the third party OAuth Provider to point to KeyCloak ( see below screenshot 1 and 2). I also changed the API security schema to use this third party OAuth Provider. 

    In screenshot 3, I tried to call the API which protected by third party OAuth provider. I expect API Connect to connect KeyCloak to introspect token and return response to indicate the token is valid. However I always encounter below error. I checked and the request indeed reached to KeyCloak. Just that looks the client_id and client_secret cannot pass to KeyCloak. Based on this IBM doc, I tried different ways to pass in client_id and client_secret but all not working. I have used Postman to get and introspect token from KeyCloak and it works. 

    https://www.ibm.com/docs/en/api-connect/10.0.5.x_lts?topic=ocac-oauth-introspection-third-party-oauth-providers

    {
        "httpCode": "401",
        "httpMessage": "Unauthorized",
        "moreInformation": "Cannot pass the security checks that are required by the target API or operation, Enable debug headers for more details."
    }

    Screenshot 1:

    Screenshot 2

    Screenshot 3:



    ------------------------------
    Guo Jun Qiao
    ------------------------------



  • 2.  RE: API Connect with third party OAuth Provider (RedHat SSO KeyCloak)

    Posted Fri October 27, 2023 04:26 AM

    You would need to look to DataPower logs at the time of you making the request to figure out what's the actual error. Alternatively, you can run your request from "Develop" section in API Manager and use Tracing capabilities to see what exactly is going wrong there. DataPower logs are also part of the Trace.



    ------------------------------
    Szymon Stupkiewicz
    ------------------------------



  • 3.  RE: API Connect with third party OAuth Provider (RedHat SSO KeyCloak)

    Posted Tue October 31, 2023 01:05 AM

    Hi Szymon Stupkiewicz, 

    Thanks a lot for your reply. I checked with IBM support team and they said APIC does not support to pass client_id and client_secret to Keycloak via request body. As a workaround, IBM support team suggested to put another API URL into introspect URL. Then in that API we can put client_id and client_secret into request body and then send request to KeyCloak introspect endpoint. 



    ------------------------------
    Guo Jun Qiao
    ------------------------------



  • 4.  RE: API Connect with third party OAuth Provider (RedHat SSO KeyCloak)

    Posted Wed November 01, 2023 09:16 AM

    That workaround is currently indeed the way to go and easy to setup. 



    ------------------------------
    Jeroen Willems
    Integration Architect - Managing Partner
    Integration Designers
    ------------------------------



  • 5.  RE: API Connect with third party OAuth Provider (RedHat SSO KeyCloak)

    Posted Wed November 08, 2023 08:03 PM

    Hi Jeroen Willems 

    Thanks a lot for your reply. 

    However I have been struggling with a issue for one month. No matter how I try, the OAuth Provider just cannot call the Introspect Proxy API (see below screenshot). I always encountered one error "Cannot pass the security checks that are required by the target API or operation, Enable debug headers for more details.". 

    Because of this issue , customer does not want to proceed with PO. 

     



    ------------------------------
    Guo Jun Qiao
    ------------------------------



  • 6.  RE: API Connect with third party OAuth Provider (RedHat SSO KeyCloak)

    Posted Thu November 09, 2023 06:14 PM

    Can you provide the config of your Third Party Oauth Provider mainly the introspect url you use?
    Also what do the Datapower logs show?



    ------------------------------
    Jeroen Willems
    Integration Architect - Managing Partner
    Integration Designers
    ------------------------------



  • 7.  RE: API Connect with third party OAuth Provider (RedHat SSO KeyCloak)

    Posted 7 days ago

    Hello Jeroen Willems sir,


    Need one help, how I could map clientid and secret to basic auth username and password in third party oauth provider (Basic Auth) in ibm v10.0.5.x_lts.
    If I send static values in that API Manager resources-> Oauth provider-> endpoints->basic auth username and pasword, it works, but if I try to map it with certain keys such as 'client.app.id, request.headers.x-ibm-client-id,client_id' it doesnt work, I need to fetch and map these id/ secret dynamically so it works for each request.
    Please guide. 



    ------------------------------
    Sumit Kapoor
    ------------------------------