Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Different client secrets in Genesys UI and State file.

    Posted 06-04-2025 01:47

    Hi,

    I am trying to create OAuth using CX as a Code and, as per latest Genesys upgrade, we should be able to view the client secret in the state file. 
    After creating the OAuth through CX code, I see two different client secrets in state file and Genesys UI for the same OAuth that has been created. 
    I guess this is not the ideal situation. Could someone please look into it.

    Thank you,
    Komali.


    #CXasCode

    ------------------------------
    Komali Sidagam
    ------------------------------


  • 2.  RE: Different client secrets in Genesys UI and State file.

    Posted 06-06-2025 09:15

    Hi Komali,

    You should not be able to see any secret information in the state file.  What you are seeing is a computed value in the state file that is not reflective of the actual client secret.  We only return the client secret at the time the oauth client is created.  

    Thanks,
        John



    ------------------------------
    John Carnell
    Director, Developer Engagement
    ------------------------------



  • 3.  RE: Different client secrets in Genesys UI and State file.

    Posted 06-09-2025 08:51
    Edited by Komali Sidagam 06-10-2025 09:58

    Hello @John Carnell,

    When you say, "We only return the client secret at the time the OAUTH client is created", where exactly we can retrieve the secret?
    I could only see client ID at the time of creation (i.e., while applying terraform configuration) in the server. I don't see the secret. 

    Thank you,

    Komali.



    ------------------------------
    Komali Sidagam
    ------------------------------



  • 4.  RE: Different client secrets in Genesys UI and State file.

    Posted 06-11-2025 03:26

    Hi @Komali Sidagam

    Assume you are using latest terraform provider version. You would not be seeing the client_secret in the state file as a default option. 

    You can dump your secret into an external file . please see directory_client_secret  in https://registry.terraform.io/providers/MyPureCloud/genesyscloud/latest/docs/resources/oauth_client

    resource "genesyscloud_oauth_client" "auth_Example" {
      state                         = "active"
      access_token_validity_seconds = 86400
      authorized_grant_type         = "CLIENT-CREDENTIALS"
      name                          = "Auth Client Example"
      roles {
        division_id = "xxxx"
        role_id     = "xxx"
      }
       integration_credential_name = "new credential"
    directory_client_secret = "${path.module}/secrets"
    
    }



    or if you want to refer this in integration credentials without hardcode, you can simply refer like example below 

    resource "genesyscloud_integration_credential" "credentials_example" {
    name = "credentials_example"
    credential_type_name = "pureCloudOAuthClient"
    fields = {
    clientId = genesyscloud_oauth_client.auth_Example.client_id
    clientSecret = genesyscloud_oauth_client.auth_Example.client_secret
    }
    }
    
    resource "genesyscloud_oauth_client" "auth_Example" {
    state = "active"
    access_token_validity_seconds = 86400
    authorized_grant_type = "CLIENT-CREDENTIALS"
    name = "Auth Client Example"
    roles {
    division_id = "xxxx"
    role_id = "xxx"
    }
    integration_credential_name = "new credential"
    }


    ------------------------------
    Venkata Hemanth Dogiparthi
    Manager, Software Engineering
    ------------------------------