Legacy Dev Forum Posts

 View Only

Sign Up

Auth Web Messaging Error oauthcodegrantjwtexchange 401 (Unauthorized)

  • 1.  Auth Web Messaging Error oauthcodegrantjwtexchange 401 (Unauthorized)

    Posted 06-05-2025 18:36

    faisyou | 2022-12-08 12:50:46 UTC | #1

    hi I m trying to get Authenticated WM blueprint to work as described here https://developer.genesys.cloud/blueprints/messenger-authentication-okta-integration-blueprint/

    I am using the github hosted page here https://genesyscloudblueprints.github.io/messenger-authentication-okta-integration-blueprint/oauth.html for testing

    I think Okta OIDC authentication flow is working but ... down stream I get an unauthorized error on the following GC API

    https://api.mypurecloud.ie/api/v2/webdeployments/token/oauthcodegrantjwtexchange

    can anyone point me what could be wrong

    I have browser console and Network HAR for the flow

    from the Network HAR I have reviewed - I can see Okta Returning AuthCode to the redirect URL

    https://genesyscloudblueprints.github.io/messenger-authentication-okta-integration-blueprint/oauth.html?code=gSSUGTGC-QjdYpQeK7aKis7kW7Vx9ljacqmm0HjLpwk&state=UiafooYvx0tX5ZI5YVMQaq6kFQUIdGvkoIeFxFkIG0X0VsxT1aocibHfis9fNP0V

    and then that code being passed to GC but I get 401 Unauthorized error from GC for the following API Call from GC

    https://api.mypurecloud.ie/api/v2/webdeployments/token/oauthcodegrantjwtexchange

    {"deploymentId":"8c69ef45-50ba-462f-9c92-32f759d89521","oauth":{"code":"gSSUGTGC-QjdYpQeK7aKis7kW7Vx9ljacqmm0HjLpwk","redirectUri":"https://genesyscloudblueprints.github.io/messenger-authentication-okta-integration-blueprint/oauth.html","nonce":"FveZQ7PDDKfMsqPbexyofWOq6QENOhUhxYHYN7wL5fg3DRUgC7aG9peJojqcSh1T","maxAge":120},"journeyContext":{"customer":{"id":"392bfa98-92ee-459e-b800-d1816a4a8db4","idType":"cookie"},"customerSession":{"id":"d7780d6b-7ce5-4997-a78e-cca00e5349b6","type":"web"}}}

    Does anybody here an idea would could be wrong

    I have verified the clientid , clientsecret and the Okta URLs are correctly configured in Genesys Cloud Integration


    Angelo_Cicchitto | 2022-12-19 15:43:16 UTC | #2

    Thanks Faisal - we discussed this offline and solved with correct discovery document URL, in your case something like: https://dev-12345678.okta.com/oauth2/default/.well-known/openid-configuration rather than https://dev-12345678-admin.okta.com/oauth2/default/.well-known/openid-configuration


    faisyou | 2022-12-12 05:42:29 UTC | #3

    Thanks really appricated your support


    John_Carnell | 2022-12-19 15:43:13 UTC | #4


    This post was migrated from the old Developer Forum.

    ref: 17564