-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
@rk1 is attempting to deploy a commit to the authjs Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this 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.
@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 |
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about scopes ?
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
☕️ Reasoning
Add Cloudinary OAuth provider.
🧢 Checklist
🎫 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.