I’m trying to authorize Zapier to connect to ERPNext using OAuth
But I’m confused what to put in “redirect uri” parameter as stated on this documentation https://frappe.io/docs/user/en/guides/integration/using_oauth
Zapier https://zapier.com/
I’m trying to authorize Zapier to connect to ERPNext using OAuth
But I’m confused what to put in “redirect uri” parameter as stated on this documentation https://frappe.io/docs/user/en/guides/integration/using_oauth
Zapier https://zapier.com/
Ok I think I figured out the redirect uri.
Now my problem is I’m getting this
I believe I have put the right Access Token URL as stated here https://frappe.io/docs/user/en/guides/integration/using_oauth
How I placed the url:
Try
Scope:
All (or the one specified in OAuth Client
DocType)
Token Placement: is in Header.
Ok I think I have passed the error after changing the “Auth Placement” to "Header as seen below
now I’m getting another error
yes, try openid
or all
or both.
Also auth placement is in header
Authorization: Bearer {{access_token}}
Note:
You cannot use Administrator account
ok thanks. Not getting the error anymore but another error occured
{“message”:“MismatchingRedirectURIError(u’(invalid_request) Mismatching redirect URI. <oauthlib.Request url="http://04d53b49.ngrok.io/api/method/frappe.integrations.oauth2.authorize?response_type=code&client_id=7a29679290&redirect_uri=https%3A%2F%2Fzapier.com%2Fdashboard%2Fauth%2Foauth%2Freturn%2FApp87007API%2F&state=1518963963.3799951\”, http_method="GET", headers="{u\‘Accept-Language\’: u\‘en-US,en;q=0.9\’, u\‘Accept-Encoding\’: u\‘gzip, deflate\’, u\‘X-Forwarded-For\’: u\‘49.146.41.209\’, u\‘Accept\’: u\‘text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8\’, u\‘Upgrade-Insecure-Requests\’: u\‘1\’, u\‘Host\’: u\‘04d53b49.ngrok.io\’, u\‘Cookie\’: u\‘user_image=; system_user=yes; user_id=Administrator; full_name=Administrator; sid=873444756e71eee5ff857f597dfb16e278048be5a6731636dee88434\’, u\‘User-Agent\’: u\‘Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36\’}", body="">',)"}
This is what I did for the redirect uri
my Zapier redirect url is shown below
I put it on my OAuth Client in ERPNext
also put the same URL in Redirect URIs
field (Text Field)
Sorry, what do you mean by cannot use Admin account? Does this mean I should create the OAuth Client using another Account?
No, You can create OAuth Client using any System Manager Account including Administrator.
You cannot login using Administrator using OAuth. e.g. when you click Sign in with Frappe
you can only sign in using non-admin account
I see, ok is this what you mean see image below “Confirmation Dialog”
I think my redirect uri is not correctly setup. Redirect uri should be correct first so that this confirmation dialog will appear right?
Still receiving this error:
I have logged out from Administrator already and used another account
{“message”:“MismatchingRedirectURIError(u’(invalid_request) Mismatching redirect URI. <oauthlib.Request url="http://04d53b49.ngrok.io/api/method/frappe.integrations.oauth2.authorize?state=1518966031.1590586&redirect_uri=https%3A%2F%2Fzapier.com%2Fdashboard%2Fauth%2Foauth%2Freturn%2FApp87012API%2F&response_type=code&client_id=7a29679290&data=\”, http_method="GET", headers="{u\‘Accept-Language\’: u\‘en-US,en;q=0.9\’, u\‘Accept-Encoding\’: u\‘gzip, deflate\’, u\‘X-Forwarded-For\’: u\‘49.146.41.209\’, u\‘Accept\’: u\‘text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8\’, u\‘Upgrade-Insecure-Requests\’: u\‘1\’, u\‘Host\’: u\‘04d53b49.ngrok.io\’, u\‘Cookie\’: u\‘user_image=; system_user=yes; user_id=johnvincentfiel%40gmail.com; full_name=johnny; sid=2f0fe96349092b2e4e9d19b868007934447c1113518a38c824760d2c\’, u\‘Referer\’: u\‘http://04d53b49.ngrok.io/login?redirect-to=/api/method/frappe.integrations.oauth2.authorize?state%3D1518966031.1590586%26redirect_uri%3Dhttps%253A%252F%252Fzapier.com%252Fdashboard%252Fauth%252Foauth%252Freturn%252FApp87012API%252F%26response_type%3Dcode%26client_id%3D7a29679290%26data%3D\\’, u\‘User-Agent\’: u\‘Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36\’}", body="">',)"}
What do you mean by “MismatchingRedirectURIError” ?
it checks for exact redirect uri even with trailing /
Both default redirect uri and redirect uris fields should be exact
Cool, thanks a lot! able to login now. 1 step forward for zapier integration
Keep sharing updates.
Add to documentation or wiki when you’re done!
sure will do!
I’m very interested in this integration effort. Please let me know if you need any help with testing.
sure I plan to finish by tomorrow. Will update you guys soon.
Thanks to @Not_a_countant for kickstarting this
I think this integration has a lot of potential for expanding the capabilities of CRM. I currently use Zapier to get email notifications of new leads generated from Facebook ads. If we could get Zapier to integrate calendar and contact information to Gsuite, it would definitely increase the workflow and reminder capabilities of CRM. Another potential use case would be adding LinkedIn user information as the basis for a new lead in CRM.
Just wanted to follow up and see if there’s been an update with the Zapier integration. Please let me know if there’s anything I can do to help out!