Skip to content

Conversation

@ThisIsMissEm
Copy link
Contributor

See the changeset for the details, I discovered whilst helping someone in the AT Protocol Touchers discord that the bsky.social server will accept DPoP bound access tokens sent as Bearer <dpop-access-token> instead of DPoP <dpop-access-token> (a fairly easy developer mistake), but the server misdirects the developer with the error "Bad token scope", because the scope on a DPoP bound access token is the actual oauth scopes like atproto transition:generic, when the bsky.social server expects com.atproto.access or similar.

This change just makes that error a little bit more visible to a developer. cc @matthieusieben

// Proof-of-Possession (PoP) tokens are not allowed here
// https://www.rfc-editor.org/rfc/rfc7800.html
throw new AuthRequiredError(
'Malformed token: DPoP not supported',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the PDS we just give Malformed token, but here I think it's probably wise to be explicit and say "DPoP isn't supported", since getting here in the first place would be already a developer error (using Bearer <token> with a DPoP bound access token.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant