Skip to main content
Best answer

Session Auth with grant_type set to client_credentials

  • December 24, 2020
  • 4 replies
  • 538 views

adilalich
Forum|alt.badge.img+1

I am working on a custom app for Striven. Striven API docs (https://api.striven.com/Help) says Authentication is OAuth 2.0 but since it uses grant_type = client_credentials, Session Auth is what I am using in Zapier App builder. I was able to get access_token via Postman but can’t seem to work it out on Zapier.
 

Postman: Collection Oauth 2.0
Token Exchange Endpoint
Test Endpoint

 

Best answer by ikbelkirasanBest answer by ikbelkirasan

@adilalich - Try this one:

headers: {
  "content-type": "application/x-www-form-urlencoded",
  Authorization: `Basic ${Buffer.from(
    `${bundle.authData.client_id}:${bundle.authData.client_secret}`
  ).toString("base64")}`,
}

 

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

adilalich
Forum|alt.badge.img+1
  • Author
  • Zapier Expert
  • 25 replies
  • December 24, 2020

Update: I know where the problem is. Client Authentication is sent as a Basic Auth header whereas in the screenshots shared above, you will see I am sending client credentials in the body which is wrong.

Can anyone tell me how I can send Client Auth in request header?

I tried sending them like this

headers: {
    'content-type': 'application/x-www-form-urlencoded',
    'Authorization': `Basic ${bundle.authData.client_id}:${bundle.authData.client_secret}` 
  }


cc: @ikbelkirasan 


ikbelkirasan
Forum|alt.badge.img+12
  • Zapier Expert
  • 555 replies
  • Answer
  • December 24, 2020

@adilalich - Try this one:

headers: {
  "content-type": "application/x-www-form-urlencoded",
  Authorization: `Basic ${Buffer.from(
    `${bundle.authData.client_id}:${bundle.authData.client_secret}`
  ).toString("base64")}`,
}

 


adilalich
Forum|alt.badge.img+1
  • Author
  • Zapier Expert
  • 25 replies
  • December 24, 2020

@ikbelkirasan You legend! Thank you brother.


ikbelkirasan
Forum|alt.badge.img+12
  • Zapier Expert
  • 555 replies
  • December 24, 2020

@adilalich You’re very welcome! :)