Recent searches


No recent searches

OAuth Auth Flow 405 Redirect Error



Posted Dec 02, 2021

TLDR; I'm getting a 405 error on the redirect step after the authorize step. Trying to figure out why.
 
I'm following the instructions here (https://developer.zendesk.com/documentation/apps/app-developer-guide/using-the-apps-framework/#authorization-code-grant-flow) and I'm essentially on the step where the application is in the install process and you just need to OAuth authenticate:
Locally on our dev auth server, I have the redirect uri set up to:
Along with the grant type being Authorization code and the Client ID/Secret.
 

In case you may be familiar with the stack: this is setup in django's rest oauth toolkit. If not, that's ok too, just dropping that bit in case it's useful to anyone else.

This leads to the issue I'm having. After the authorize screen (our own):

I get the following error from https://zis.zendesk.com/api/services/zis/connections/oauth/callback?code={thecode}&state={statestuff}:

This is where I'm quite stuck. I had thought that with it returning the code, aka the auth token, that I'd be in the green. Perhaps I'm missing something obvious. Please let me know.


0

4

4 comments

Bump. I was told coming here was a way to better get in contact with Zendesk's Engineering team by support.

0


image avatar

Eric Nelson

Zendesk Developer Advocacy

Hey Joseph, 

Would you be able to provide the relevant code snippets (omitting any identifying info)? This will help us to be able to debug the issue much more effectively. 

Thanks!  

0


Sure.

This is a section of the manifest.json:

"oauth": {
  "client_id": "---",
  "client_secret": "---",
  "authorize_uri": "https://someurl.com/o/authorize",
  "access_token_uri": "https://someurl.com/o/token",
  "scope": "read write"
},
"parameters":[
  {
    "name":"token",
    "type":"oauth"
  }
],

This is the call that is made to our services:

exportconstzafApi = {
  getOrder: (id: number): Promise<Order> => {
    constsettings = {
      url:`${baseURL}order/${id}`,
      headers: {
        "Authorization":"Bearer {{setting.token}}",
      },
      secure:true,
      type:"GET",
      dataType:"json",
      contentType:"application/json",
    }
    return zafClient.request(settings)
  },
}
 
The ZAFClient is imported within the index.html file via a:
 
 
Please let me know if that helps or if there is anything else I can provide. Thank you for your help.

0


Bump.

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post