Skip to content
This repository has been archived by the owner on Apr 15, 2024. It is now read-only.

underscore templates are not working in Autherization_Url #4

Closed
skhussainbasha opened this issue Jan 30, 2018 · 13 comments
Closed

underscore templates are not working in Autherization_Url #4

skhussainbasha opened this issue Jan 30, 2018 · 13 comments

Comments

@skhussainbasha
Copy link

To my freshdesk app, I am Using OAuth based authentication.
My third party API wants to send client_id along with autherization_url like "authorize_url": "https://login.teamviewer.com/oauth2/authorize?response_type=code&client_id=<%= oauth_iparams.client_id %>&redirect_uri=http%3A%2F%2Flocalhost%3A10001%2Fauth%2Fcallback"
but in freshdesk underscore template doesnot support in "authorize_url". and "token_url";

Can please give me suggestion on how to over come this problem.

@raghuram-periaswamy
Copy link

It must work. We do support templating in authorize and token url. Do you get any error while testing?

@skhussainbasha
Copy link
Author

skhussainbasha commented Jan 30, 2018 via email

@raghuram-periaswamy
Copy link

Are you using the latest version of the fdk?

@skhussainbasha
Copy link
Author

Yes, i tried in 4.1.5 and 4.1.7

@raghuram-periaswamy
Copy link

Please ensure you have provided authorize_url as https://login.teamviewer.com/oauth2/authorize and the token_url as https://login.teamviewer.com/api/v1/oauth2/token in oauth_config.json

@skhussainbasha
Copy link
Author

{
"client_id": "<%= oauth_iparams.client_id %>",
"client_secret": "<%= oauth_iparams.client_secret %>",
"authorize_url": "https://login.teamviewer.com/oauth2/authorize?response_type=code&client_id=<%= oauth_iparams.client_id %>&redirect_uri=http%3A%2F%2Flocalhost%3A10001%2Fauth%2Fcallback",
"token_url": "https://webapi.teamviewer.com/api/v1/oauth2/token",
"options": {},
"token_type": "account",
"oauth_iparams": {
"client_id": {
"display_name": "client_id",
"description": "Please enter your client_id",
"type": "text",
"required": true
},
"client_secret": {
"display_name": "client_secret",
"description": "Please enter your client_secret",
"type": "text",
"required": true
}
}
}

my teamviewer api needs have client_id in authorize_url
See my API ref:GET login.teamviewer.comoauth2/authorize?response_type=code&client_id=12333-
133Ea4Hdf3e9ec0543fX&redirect_uri=https%3A%2F%2Fclient%2Eexample%2Ecom%2Fcb

@raghuram-periaswamy
Copy link

From the configuration that you have provided, it seems like you have used templating in client_id and client_secret which is not supported. Please replace it with actual client_id and client_secret values. The authorize and token URL must be changed to the ones that I have provided.

@skhussainbasha
Copy link
Author

first point: Then how it will work as dynamic OAuth authentication.You are suggesting me to hard code the client_id and client_secret.I confirmed with you one of your developers he said "templating only works in client_id and client_secret".
second point: If I replace as suggested then what about the parameter that my API is expecting to have in autherize_url?

@raghuram-periaswamy
Copy link

Regarding OAuth, the developer of the app must provide in the client_id and client_secret. The user who installs the app is not expected to provide these credentials.

The parameters that need to be passed through the authorize URI will be taken care by our OAuth authentication system. The parameters that you referred in the documentation is supposed to be provided if the OAuth flow is done manually without a client. In our case all the actions are handled by an OAuth client.

@skhussainbasha
Copy link
Author

Let me ask the last question.
I have given client_id and client_secret fields if any customer installed my app then how he will provide client_id and client_sercret of his app?

@raghuram-periaswamy
Copy link

As i told, the client id and secret must be provided by the developer of the app and not by the user.

Client ID and secret stand to identify your app(that you have developed) uniquely. And must not be specific to user.

@skhussainbasha
Copy link
Author

ok thanks.

@raghuram-periaswamy
Copy link

Hope it helped. Im closing the issue.

hemchander23 added a commit that referenced this issue Jul 26, 2021
* [DEVREL-1008] Add: Voucher code generator sample /Demo-Apps. (#344)

* 📦 NEW: Voucher code generator

* Address: Review #1

* Merge (#3)

* Add newhire-onboarding-invites

* Update README

* [MP-10156] Newhire Onboarding Invites for freshteam

* [MP-10156] Newhire Onboarding invites for freshteam

* [MP-10156] name changed to newhire-onboarding-invites

* [MP-10156] newhire-onboarding-invites

* [MP-10156] generate operations fields

* [DemoApps] Domain whitelisting, Iparams re-org

* [DEVREL-1166] Tweak: Spinner in Joke component (#331)

* Add: config-iparams-html-freshservice

* New: config-iparams-html-freshservice

* Twek: Joke Components
Add: spinner as a loding sign during the API request phase

* Tweak: Joke component at full_page

* Update: Incorporated Review:1

* Update: Code Format

* Update: Punchline via Dependency Injection

* 🐛 FIX: whitelisting changes (#341)

* 🐛 FIX: whitelisting changes

* 📖 DOC: replace screenshots and features demonstrated

* 👌 IMPROVE: add whitelisting domain support (#342)

* 👌 IMPROVE: add whitelisting domain support

* 📖 DOC: list features demonstrated

* [DEVREL-1180] Refactor: Ticket-merger Freshdesk sample-app  (#340)

* ♻️ Refactor: Ticker Merger

* rm: .gitignore

* Security fixes for Demo Apps dir (#2)

* Revert "[DEVREL-1180] Refactor: Ticket-merger Freshdesk sample-app  (#340)"

This reverts commit c068b68.

* Revert "👌 IMPROVE: add whitelisting domain support (#342)"

This reverts commit 2b451e4.

* Revert "🐛 FIX: whitelisting changes (#341)"

This reverts commit bc05622.

* Revert "[DEVREL-1166] Tweak: Spinner in Joke component (#331)"

This reverts commit e42ea10.

* New line to files

* `request_api` whitelisting: httpbin -> xkcd API

* Fix `authentication_basic` app

* `custom_entities` app fix

* [DemoApps] Domain whitelisting, Iparams re-org

* New line to files

* [DEVREL-1166] Tweak: Spinner in Joke component (#331)

* Add: config-iparams-html-freshservice

* New: config-iparams-html-freshservice

* Twek: Joke Components
Add: spinner as a loding sign during the API request phase

* Tweak: Joke component at full_page

* Update: Incorporated Review:1

* Update: Code Format

* Update: Punchline via Dependency Injection

* 🐛 FIX: whitelisting changes (#341)

* 🐛 FIX: whitelisting changes

* 📖 DOC: replace screenshots and features demonstrated

* 👌 IMPROVE: add whitelisting domain support (#342)

* 👌 IMPROVE: add whitelisting domain support

* 📖 DOC: list features demonstrated

* [DEVREL-1180] Refactor: Ticket-merger Freshdesk sample-app  (#340)

* ♻️ Refactor: Ticker Merger

* rm: .gitignore

* Security fixes for Demo Apps dir (#2)

* Revert "[DEVREL-1180] Refactor: Ticket-merger Freshdesk sample-app  (#340)"

This reverts commit c068b68.

* Revert "👌 IMPROVE: add whitelisting domain support (#342)"

This reverts commit 2b451e4.

* Revert "🐛 FIX: whitelisting changes (#341)"

This reverts commit bc05622.

* Revert "[DEVREL-1166] Tweak: Spinner in Joke component (#331)"

This reverts commit e42ea10.

* `request_api` whitelisting: httpbin -> xkcd API

* Fix `authentication_basic` app

* `custom_entities` app fix

* Fix log

* Used aws-sdk/client-organizations

* `config-iparams-html-freshdesk`  whitelisting fix

* `config-iparams-html-freshservice`  whitelisting fix

* `config-iparams-json-freshdesk` whitelisting fix

* `config-iparams-json-freshservice` whitelisting

* `config-placeholders-freshdesk` whitelisting fix

* `custom_installation_page_app` whitelisting

* `dynamic_iparams` disclaimer and whitelisting

* `ticket_details_freshservice_app` Remove iparams_test_data

* `Ticket_creator` app - scope, CDN, whitelisting fixes

* `Github_Issue_Creator` CDN, bug fix, whitelisting, scope change

* `config-iparams-json-freshservice` minor fixes

Co-authored-by: Hamsini-Sivalenka <hamsini.sivalenka@freshworks.com>
Co-authored-by: Teja Kummarikuntla <teja.kummarikuntla@freshworks.com>
Co-authored-by: Shaik Saif Ali <saifali.shaik@freshworks.com>

Co-authored-by: Teja Kummarikuntla <teja.kummarikuntla@freshworks.com>
Co-authored-by: Hamsini-Sivalenka <hamsini.sivalenka@freshworks.com>
Co-authored-by: Shaik Saif Ali <saifali.shaik@freshworks.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants