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

EU datacenter doesn't work #61

Closed
balazs92117 opened this issue Feb 23, 2022 · 1 comment
Closed

EU datacenter doesn't work #61

balazs92117 opened this issue Feb 23, 2022 · 1 comment

Comments

@balazs92117
Copy link

The provider doesn't work, if I choose "EU" datacenter in the config. I got following error:
oauth2: server response missing access_token

I think it is because in oauth/oauth.go there is a hard coded TokenURL, and not a dinamically choosed based on the config, like in the actual CRUD actions. So the action can't run, because the authentication (getting the acces_token) happened on a different server, not on which the action tries to run.

With the "US" datacenter, everything works fine!

@jim-billy-zoho
Copy link
Collaborator

jim-billy-zoho commented Mar 1, 2022

Hi Bala,

This issue occurs when the users give the generated code for the variable "oauth2_refresh_token". Below command has to be executed for generating refresh token from grant code.

curl https://accounts.zoho.eu/oauth/v2/token
-X POST
-d "client_id=<CLIENT_ID>"
-d "client_secret=<CLIENT_SECRET>"
-d "code=<GENERATED_CODE>"
-d "grant_type=authorization_code" --insecure

You will get a response similar to the one below.
{"access_token":"1000.abcd.abcd","refresh_token":"1000.abcd.abcd001","token_type":"Bearer","expires_in":3600}

The refresh_token in the above response should be given in the terraform configuration file.
oauth2_refresh_token = "<SITE24X7_OAUTH2_REFRESH_TOKEN>"

Please refer "PART 3: GENERATE ACCESS AND REFRESH TOKEN" in the API doc - https://www.site24x7.com/help/api/#authentication

Do let us know if you face any issue.

Regards,
Jim

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