Recent searches


No recent searches

Creating and using OAuth tokens with the API



Posted Mar 26, 2021

This is a continuing discussion about the article Creating and using OAuth tokens with the API in the developer documentation.


0

7

7 comments

You're correct @... -- OAuth access tokens/keys are always tied to a particular user. When that key is used, the action is effectively performed under the user who created the key.

That's why, depending on the context, securing keys is important. For example, if the key was created by an admin and gets made public somehow, whoever has it can perform any action that admin can perform. If a key is leaked somehow, it should be revoked immediately.

0


The statement that "using OAuth tokens for authentication doesn't tie the requests to a specific username and password" is true in the sense that anyone in possession of the OAuth token can use it. However, in a way it is tied to a specific user: the user that created it. For example, if user X creates the token and gives it user Y and user Y uses the token to add a comment to a ticket without setting the author_id of the comment to user Y, then the comment by default will be attributed to user X (the creator of the token).  That appears to be the phenomenon encountered by one user as described in his comment: https://support.zendesk.com/hc/en-us/articles/226316187/comments/360001755167 

0


Is it possible to use this method/non-grant type tokens to grant access for the Chat APIs?

The documentation for the Chat Conversation API references setting the scope (singular) to read, write, and chat.

The Create Token end point has scopes (plural) and errors if you include 'chat'.

Requested scopes are invalid. Invalid scopes: chat

Is there another method to set the scope for non-grant type token or do you have to use one of the grant type token methods?

0


Hi @...,

The above article focuses on generating an access token for Zendesk Support.

For Zendesk Chat, you'll want to follow the instructions at: Generating a Zendesk Chat OAuth token

Following those instructions, along with the need for including "chat" in the scope, will return an access token that you can use with the Chat Conversations API.

It can be confusing, but for legacy reasons, generating access tokens for Zendesk Support, Chat, and Sell are different unfortunately (for now). Hope this clarifies things!

0


We have an ETL script from Zendesk to our own Database; we want to make sure this one continues to work even if the person that generates the token is no longer with the company. We've been using a basic + token authentication method; however, it is tied to a user. 

Would you recommend using an OAuth token instead? Would this keep the token alive even if the user/admin that generates it is deactivated?

Thanks

0


hi, 

i have been following the documentation on implementation of Chat API https://developer.zendesk.com/rest_api/docs/chat/auth

there is a step to getting access token for user, I was trying to do the instruction as in screenshot 

 

the part of 

code={your_code}

is not clear to me, what is this {your_code} suppose to be filled in?

 

thank you! 

0


Hi @.... For API access to Zendesk Support, these are the possible ways: How can I authenticate API requests

All the available approaches are tied to a user, however. There is no "machine to machine" type user. 

The closest you can get to creating a more permanent, non-user-based access token is to fake it and create a specially identified "agent" for these purposes.

The bottom line is, if a user is disabled, their access is disabled, even if they use an OAuth access token. Hope this at leasts sets expectations!

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post