Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to access the client secret from a genesyscloud_oauth_client resource #857

Closed
tarlingovo opened this issue Feb 16, 2024 · 3 comments
Closed

Comments

@tarlingovo
Copy link

tarlingovo commented Feb 16, 2024

Hi,

How does one get the client secret from a client credentials OAuth resource created with genesyscloud_oauth_client

It seems like a standard use-case but I can't find it documented anywhere. The secret seems to be exposed on the API at https://developer.genesys.cloud/devapps/api-explorer#get-api-v2-oauth-clients--clientId-

Many thanks

@dginty4
Copy link
Collaborator

dginty4 commented Feb 16, 2024

Hi,

Terraform is used to create and manage resources, it is not intended to be used to extract read only data, in this case the client secret, from the created oauth client (or at least our provider is not). Cx as Code will manage your oauth clients but if you need to get the oauth secrets you will need to find the oauth client created by terraform in the UI or call GET /api/v2/oauth/clients/{clientId}.

If you need to get the id of oauth client you created you can use this command to read the resource's state

terraform state show genesyscloud_oauth_client.<resource_name>

I would also recommend installing our CLI tool, if you don't already have it. It can call our API's and is a helpful tool when using Cx as Code for situations like this.

Regards,
Declan

@tarlingovo
Copy link
Author

Thanks @dginty4 but I thought it was pretty standard practice to expose properties of terraform resources to be used in properties of other resources.

@dginty4
Copy link
Collaborator

dginty4 commented Feb 16, 2024

As far as I know the only properties we expose are those used to manage the resource, we don't expose read-only attributes. What is your use case for this? I'm not aware of any resources that reference the client secret.

@dginty4 dginty4 closed this as completed Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants