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

Missing OAuth Client Credentials #121

Open
dingfeldera opened this issue Nov 4, 2022 · 1 comment
Open

Missing OAuth Client Credentials #121

dingfeldera opened this issue Nov 4, 2022 · 1 comment

Comments

@dingfeldera
Copy link

Hi,

I´ve tried the samples but was not able to login via OAuth. I didn´t provide a token in the secure.json file as it is optional but nevertheless the SDK isn´t retrieving a token from the backend.

I also cannot find any OAuth Client Credentials Support in the coding of the SDK.

Regards,
Andy

@rbndelrio
Copy link

rbndelrio commented Mar 26, 2024

This issue is still ongoing.

PR #68 seems to implement support for client credentials but it was merged to the development branch, not master and thus never got released.

Far from ideal but this can be patched temporarily by pointing the package to the github repo:

{
  "dependencies": {
    "@bynder/bynder-js-sdk": "github:Bynder/bynder-js-sdk#development",
    "@bynder/compact-view": "^4.2.0",
  }
}

Usage looks like this:

import Bynder from "@bynder/bynder-js-sdk";

const bynder = new Bynder({
  baseURL: "...",
  clientId: "...",
  clientSecret: "...",
  // redirectUri must be undefined
});

if (!bynder.api.token) await bynder.getToken();
// or to specify scope: bynder.getToken(undefined, "offline asset:read")

// test request
const result = await bynder.getMediaList({ type: "image", limit: 9, page: 1 })
console.log(result)

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

No branches or pull requests

2 participants