IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Authorization Required: Unauthorized pub.client:http

    Posted Mon July 24, 2023 12:53 PM

    Hi,
    I am getting the below error “Authorization Required: Unauthorized” while trying to get the Token from the Token URL using pub.client:http
    Below are the parameters I am giving.
    client_id
    client_secret
    grant_type = client_credentials
    url = token url
    method = post


    But I am able to generate the token and post the message successfully through postman using OAuth2.0. Can you please let me know what is missing in the call I am making to pub.client:http to get the access token?


    #webMethods
    #webMethods-io-Integration


  • 2.  RE: Authorization Required: Unauthorized pub.client:http

    Posted Mon July 24, 2023 01:37 PM

    From your Postman screen shot it is using basic auth to send the credentials and a single field for the grant_type.

    And the IS http call is using only the form fields, not basic auth.

    Perhaps the server only supports the former (seems odd).

    Or perhaps something is amiss with the URL? Is the tail of the URL /oauth/token?


    #webMethods-io-Integration
    #webMethods


  • 3.  RE: Authorization Required: Unauthorized pub.client:http

    Posted Mon July 24, 2023 03:16 PM

    I also tried with giving client_authentication = Basic but still the same error.
    The Access Token URL ends like this - xxx/oauth2/token/generate


    #webMethods-io-Integration
    #webMethods


  • 4.  RE: Authorization Required: Unauthorized pub.client:http

    Posted Mon July 24, 2023 03:39 PM

    Can you share exactly how you did this? If you use Basic auth in wM IS, you’d pass the credentials within the auth document and only the grant_type field under args. There would not be anything named “client_authentication”.

    What might help is if you review the Console, and perhaps “Show raw log”, within Postman to see what it does. Based upon your screen shot, it should look something like this:

    As can be seen here, Basic auth is used in the Authorization header, and the x-www-form-urlencoded form has just one field. To do the same in wM IS:

    data/args/grant_type = client_credentials
    auth/type = Basic
    auth/user = (map from client_id)
    auth/pass = (map from client_secret)

    wM IS automatically sets the Content-Type.


    #webMethods
    #webMethods-io-Integration


  • 5.  RE: Authorization Required: Unauthorized pub.client:http

    Posted Mon July 24, 2023 04:21 PM

    That’s amazing! I just followed what you gave and it worked perfectly!!! Thanks a ton! :slightly_smiling_face:


    #webMethods
    #webMethods-io-Integration