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

Unable to authenticate using Client Credentials #41

Open
kristianandersendk opened this issue Feb 2, 2024 · 1 comment
Open

Unable to authenticate using Client Credentials #41

kristianandersendk opened this issue Feb 2, 2024 · 1 comment

Comments

@kristianandersendk
Copy link

I have setup my oauth2 application in Bynder to authenticate using Client Credentials.
I can authenticate using postman by calling the /token endpoint.

When connecting using the python sdk, it looks like the client credential flow is not implemented correctly.
The OAuth2Session will default to a WebApplicationClient where a BackendApplicationClient would be needed for client credential authentication.

In my current workaround im fetching the token up front, but it would be nice if the sdk could handle oauth2 authentication using client credentials

client = BackendApplicationClient(client_id='<clientId>')
oauth = OAuth2Session(client=client)
token = oauth.fetch_token(token_url='<tokenurl>', client_id='<clientId>',client_secret='<clientSecret>')

bynder_client = BynderClient(
    domain='<bynderDomain>',
    redirect_uri='', #required but should not be used
    token = token, #input the token to avoid the bynder client trying to fetch
    client_id='<clientId>', #Not used since the token is supplied
    client_secret='<clientSecret>',#Not used since the token is supplied
    scopes=['<scope>','<scope>']
)
@dylanmartins
Copy link
Contributor

Hey @kristianandersendk sorry for the late response and thanks for the message!

We will create a ticket and look into it in the future, in the meanwhile, if you want you can also create a PR with the changes and submit it, we can code review and merge it :)

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