Closed2

Notion APIで「Login With Notion」はまだ難しい → できるようになった!

catnosecatnose

Notion APIはOAuthに対応しているのでLogin with Notionをやってみようと思い立った。

色々と調べているとNotionの開発者向けSlackコミュニティで、Notionチームの方が2021/5/19に以下のようにコメントしているのを見つけた(太字は僕が装飾したもの)。

i’ll share a bit of what we’re thinking. currently, all integrations are added to the workspace, which makes them independent of any specific user in the workspace.

this is a useful property because it means when a specific user leaves a workspace or their access level changes, the integrations they added don’t disappear or have their access demoted. this is also why its important that the user who adds this workspace-bound integration is an admin. we’d also encourage your integrations not to associate the returned access token with a specific user. instead, you might want to store it with an account or organization that the user is a part of.

in the future, we’d like to introduce the concept of an integration that is bound to a user (instead of to a workspace). among other differences, this type of integration (or this type of authorization for the same integration) would return a user ID alongside the access token. if you’re hoping to map user identities in Notion to your own user identities, this kind of authorization will be a better fit. I think Login With Notion is just a specific way of using this kind of authorization.

2021年8月時点では、Notion APIの認可はワークスペース単位のみで、ユーザー単位には対応していない。ワークスペースに複数人が所属する可能性を考えると、現時点でLogin with Notionをやるのは難しい。

このスクラップは2021/08/29にクローズされました