Our application is using Auth0 to authenticate users. We configured Zendesk Application in our Auth0 account and it is working when end users log in with the sign-in link inside Zendesk.
Now, however, we are trying to contact Zendesk API from third party application with the same exact OIDC client information used by Zendesk. Users of our application should have access to their Zendesk tickets via Zendesk Request API (https://developer.zendesk.com/api-reference/ticketing/tickets/ticket-requests/). However, when user signs in our application, which in return sends request to Zendesk Request API along with the bearer, the Request API gives 401 Unauthorized response with the following error:
"error": "invalid_token",
“error_description": "The access token provided is expired, revoked, malformed or invalid for other reasons."We have also tried to test this direct call to the Request API with Postman by using following configurations:
- Authorization type: OAuth 2.0
- Grant type: Authorization Code (with PKCE)
- Callback URL: URL from the Auth0 Zendesk application
- Auth URL: OAuth Authorization URL from the Auth0 Zendesk application
- Access token URL: OAuth Token URL from the Auth0 Zendesk application
- Client ID: ClientID from Auth0 Zendesk application
- Client secret: Empty
- Scope: “openid email”
- Client authentication: “Send client credentials in body”
- Auth request query parameters: “audience”
We also tried the same without PKCE and client id and secret. It gives the same problem.
With this Postman configuration we manage to get new access token, but using it in request to Zendesk Request API we get the same error as before in our application:
"error": "invalid_token",
“error_description": "The access token provided is expired, revoked, malformed or invalid for other reasons."Note that the same configuration works when we login to Zendesk portal itself.
Our access token payload looks like this:
{
"iss": "https://[OUR_AUTH0_SUBDOMAIN].eu.auth0.com/",
"sub": "auth0|[AUTH0_USER_ID]",
"aud": [
"[OUR_INTERNAL_AUDIENCE]",
"https://[OUR_AUTH0_SUBDOMAIN].eu.auth0.com/userinfo"
],
"iat": 1712656741,
"exp": 1712657641,
"scope": "openid email",
"azp": "3FySxa06Fsf8ODU8WqyidSp3d2PTEwi9"
}
Our id token payload looks like this:
{
"email": "[USER_EMAIL]",
"email_verified": true,
"iss": "https://[OUR_AUTH0_SUBDOMAIN].eu.auth0.com/",
"aud": "3FySxa06Fsf8ODU8WqyidSp3d2PTEwi9",
"iat": 1712656598,
"exp": 1712692598,
"sub": "auth0|[AUTH0_USER_ID]",
"sid": "BJfNIHC8ivg8CR7Yi8Dpoq1hfWR-nYbE"
}According to jwt.io both tokens are valid and signature is verified.
Is the Zendesk API out of the scope of OpenID Connect EAP or is there something more we need to do?