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

feat(providers): Add Cloudinary provider #11922

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rk1
Copy link

@rk1 rk1 commented Sep 29, 2024

☕️ Reasoning

Add Cloudinary OAuth provider.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

📌 Resources

Note: Currently obtaining client-specific credentials is done by contacting Cloudinary support. I've already done this for one of my apps which is using this provider and I'm happy to assist if needed.

Copy link

vercel bot commented Sep 29, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 29, 2024 10:17am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Sep 29, 2024 10:17am

Copy link

vercel bot commented Sep 29, 2024

@rk1 is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added providers core Refers to `@auth/core` labels Sep 29, 2024
@rk1 rk1 changed the title Add Cloudinary provider feat(providers): Add Cloudinary provider Sep 29, 2024
Copy link

@soleoak soleoak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smoke Tested 🙅

The code changes and documentation look good. I have not pulled this down to test though.

@rk1
Copy link
Author

rk1 commented Oct 10, 2024

@ThangHuuVu @ubbe-xyz @ndom91 @balazsorban44 Is there something I can add to this PR to make it easier to review? Tried to follow the guide and the examples from a couple of provider PRs that have been merged, but happy to assist with anything else, thank you!

### Notes

- The Cloudinary `userinfo` endpoint returns only a `sub` which is used for both the `id` and the `email` in the user's profile. If you'd like to get more information about the user – you can use the [Cloudinary Account Provisioning API](https://cloudinary.com/documentation/provisioning_api)
- If the OAuth token is used against the Admin/Upload API, the user must be assigned a Master Admin role within the product environment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

temporary limitation. We are working hard to apply granular permission for all accounts, so every user will be able call APIs (using OAuth token)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification @eitan-revach, I think this should be okay to merge as-is and refine after granular permissions are implemented

options: OAuthUserConfig<P>
): OAuthConfig<P> {
return {
id: "cloudinary",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about scopes ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea what a good default value might be or any docs on that? Maybe I can add something similar to how it's done for the Apple provider: https://github.com/nextauthjs/next-auth/blob/main/packages/core/src/providers/apple.ts#L170C33-L170C121

*
* ### Notes
* - If the OAuth token is used against the Admin/Upload API, the user must be assigned a Master Admin role within the product environment
* - If you'd like to get more information about the user – you can use the [Cloudinary Account Provisioning API](https://cloudinary.com/documentation/provisioning_api)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oauth token with provisioning_api? for now, with very limited support.
Might be changed later this year.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know @eitan-revach, happy to update in a follow-up PR if this gets changed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core` providers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants