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 support? #73

Closed
justjake opened this issue May 18, 2021 · 5 comments
Closed

OAuth support? #73

justjake opened this issue May 18, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@justjake
Copy link
Contributor

How do I use the SDK to complete the oauth flow?

@muuvmuuv
Copy link

Do you mean how you authorize? Head over to https://www.notion.so/my-integrations and create a new integration and paste the token into the client.

@justjake
Copy link
Contributor Author

justjake commented Jun 9, 2021

@muuvmuuv I am referring to the OAuth flow for public integrations which involves sending a POST request to https://api.notion.com/v1/oauth/token

@pllnk pllnk added the enhancement New feature or request label Jul 9, 2021
@mogita
Copy link

mogita commented Mar 11, 2023

For future searchers, although lacking OAuth functions from this library is apparently a miss, implementing it, for example with Express, can be fairly straight forward since it's not OAuth2. You redirect your user to the /oauth/authorize endpoint, having them allow access, and Notion redirects user's browser back to your redirect_uri so you can use the code to call /oauth/token for the access token which represents the user. And this wraps up the whole process. Currently Notion API doesn't require you to encrypt or decrypt anything which is way easier than many other OAuth providers.

This is not the most accurate description of the OAuth process but you get the gist. Also you can follow this article if you just want some working code https://naomiperez.netlify.app/notion-oauth-flow/

@cooljameswei
Copy link

Hi @mogita
Could you please share the that repo?
I'm currently working on a project which require notion public integration.
I've done with internal integration by specify certain pages but get stuck with public integration(OAuth 2).
I'm looking forward to your reply.

@rhart92
Copy link
Contributor

rhart92 commented Aug 14, 2023

/v1/oauth/token has now been incorporated into the SDK as of v2.2.11 🎉

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

No branches or pull requests

6 participants