Open dentro-innovation opened 3 months ago
After a talk with the guys from clerk on their discord, it seems like how I set up the oauth retrieval isn't quite the best practice because after signing up it doesn't redirect me back to my app: https://discord.com/channels/856971667393609759/1275507212059541574/1275908575675551764
Today I tried setting up Notion SSO using reflex-clerk.
As it seems, the only thing that was needed for that is in Commit 1.
Commit 2 is meant for requesting OAuth access tokens.
I need this to get access to the users notion and e.g. create new pages.
The method
get_user_oauth_access_token
isn't clean at all, and it just happens to work with Notion on my machine:self._handle_response
because I ran into parsing errorsI got it to work on my own machine with the following functions using the pypi package
notion_client
:To be able to actually write into the users Notion I couldn't use Clerks Dev Notion Integration but needed to create a public integration myself with write permissions:
Then I filled in the Client ID and Secret in Clerk, and set the scopes to
read
,insert
andupdate
, and copied theAuthorized redirect URI
back into the Notion Integration:With this whole setup I was able to create a new page under my parent page as shown above in the python code.
I'd be very happy if you could try it out yourself, improve the code and then release a new version 🙏 Thanks for maintaining this project so far @kroo !