Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OAuth doesn't work #390

Closed
stefanielauer opened this issue Oct 20, 2023 · 1 comment
Closed

OAuth doesn't work #390

stefanielauer opened this issue Oct 20, 2023 · 1 comment
Labels

Comments

@stefanielauer
Copy link

Describe the Bug
We are trying to authenticate via Oauth but keep getting Error: Request processing failed: Raw request failed: Missing credentials for Basic Authentication.

Example Code

import {createClient as zendeskCreateClient} from 'node-zendesk'
const client = await zendeskCreateClient({
        endpointUri: "https://subdomain.zendesk.com",
        token: "xxx",
        oauth: true
    })
client.search.query("some query")

Expected Behavior
Client authenticates with OAuth and executes the call.

Actual Behavior
Execution fails with Error: Request processing failed: Raw request failed: Missing credentials for Basic Authentication.

Environment Information

  • node-zendesk version: 5.0.1
  • Node.js version: v19.7.0
  • Operating System: Mac OS

Additional Context
Assumption: the oauth flag from ZendeskClientOptions might not be transferred to ClientOptions when creating the client.

@blakmatrix
Copy link
Owner

@stefanielauer My apologies for the inconvenience. There was indeed a confusion between the old oauth property and the new useOAuth property. I have updated the code to ensure that either property will work: see the commit.

Additionally, I have updated the example file to reflect the correct way of checking for OAuth.

Please download the latest version 5.0.2 of the package, which includes this fix. I believe this should resolve the issue you're facing with OAuth authentication. Feel free to reach out if you encounter any further problems or have additional questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants