Try ERPNext Buy Support Partners Foundation

POST To MYOB API - Authentication

I’m taking the first baby steps in what I’m hoping will become a complete one way connector from ERPNext to MYOB.

I only program in my spare time, so my knowledge is a bit fragmented. But I understand working with APIs and I’ve wrapped my head around Oauth2. I’ve been learning some Flask and I’ve run Postman samples and I’m kind of figuring out the structure.

Here’s where I’m getting stuck conceptually, and I’m sure this is my lack of understanding of the Frappe framework, but I’m stuck with the first Oauth2 step which is redirecting the user to a url that returns the access code.

What confuses me is how I would approach this in Frappe. Do I use JavaScript to do the redirect, or Python? Like am I supposed to do the redirect in JavaScript and then send the url result to Python using AJAX and then do everything else in Python? Or can I use frappe.local.response[redirect] in Python and not even use JavaScript at all?

Now I have no trouble doing this step in a python interpreter, and when I look at Flask I think, if I was using Flask, I would do the whole thing in Flask and not even touch JavaScript.

I guess it’s Frappe that I’m struggling to understand and how Python and JavaScript work together in the framework.

Frappe acts as OAuth2 authorization server. Add OAuth Client and use it in any integrations.

Frappe uses Social Login Key as OAuth2 Client for known and custom OAuth2 providers. Social Login Key is limited to login using external OAuth2 provider.

Related discussion:


Oh, I saw that, but when I read “Oauth2 server” I assumed that meant this module was for setting up an Oauth2 server for connecting to the ERPNext API from a third party app.

Thanks for the help, I will read through the documentation.