-
Notifications
You must be signed in to change notification settings - Fork 554
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: Add authorization scopes & remove OpenID compatibility #2734
Conversation
55befa7
to
8ff8e68
Compare
e004685
to
4472c23
Compare
4472c23
to
b26d33c
Compare
c3abe00
to
30e319a
Compare
b26d33c
to
325ac80
Compare
71405fc
to
9aae108
Compare
5050389
to
f8a820a
Compare
…en building the authorization request.
4c85f4a
to
1f03d97
Compare
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.
A few questions worth working through, but this looks great— pretty much read to roll.
0bd7014
to
ffcbaf6
Compare
@matthieusieben @devinivy I understand that this scoping feature needs to break openID compatibility through discussions, |
.changeset/six-swans-talk.md
Outdated
--- | ||
"@atproto/pds": patch | ||
--- | ||
|
||
Disable ability to list app passwords when using an app password |
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.
I believe this change was reverted.
This PR adds support for scopes during the authorization flow. Three scopes are introduced
atproto
: acts as a negotiation scope between the client and the server so that both know that this is an ATProto OAuth flowtransition:generic
: This temporary scope allows to give access tokens issued through OAuth the same permissions as current "app passwords".transition:chat.bsky
: Grants access to chat functionalities, as was the case for "privileged app passwords"This change also removes the compatibility with OpenID.
The reason is that although the implementation was technically OpenID compatible, ATProto identifiers are distributed identifiers. When a client relies on OpenID to authenticate users, it will use the auth provider (issuer) in combination with the identifier to uniquely identify the user. Since ATProto identifiers are meant to be able to move from one provider to the other, OpenID compatibility could break authentication after a user was migrated to a different provider. Future authentication attempts would be considered as distinct identities from the one previsouly used by the client.
The way OpenID compliant clients would adapt to this particularity would typically be to remove the issuer + identifier combination and use the identifier alone. While this is indeed the right way to handle ATProto identifiers, it requires more work to avoid impersonation. In particular, when obtaining a user identifier, the client must verify that the issuer of the identity token is indeed the server responsible for that user. This mechanism being not enforced by the OpenID standard, OpenID compatibility could lead to security issues. For this reason, we decided to remove OpenID compatibility from the OAuth provider.
Note that a trusted central authority could still offer OpenID compatibility by relying on ATProto's regular OAuth flow under the hood. This capability is out of the scope of this library.