WIP: Add PKCE support to remoteStorage OAuth #256
Draft
raucao
wants to merge 1 commits from
feature/rs_auth_pkce into master
pull from: feature/rs_auth_pkce
merge into: kosmos:master
kosmos:master
kosmos:feature/rs_storage_dashboard
kosmos:feature/rs_device_tokens
kosmos:feature/nostr-onboarding-ruby
kosmos:live
kosmos:chore/btcpay_expired_paid-late
kosmos:feature/nostr-onboarding
kosmos:feature/import_deno_modules
kosmos:docs/integrations
kosmos:feature/ldap_aci
kosmos:feature/contribution_nav
No Reviewers
Labels
Clear labels
bug
design
dev environment
docs
duplicate
enhancement
feature
good first issue
idea
invalid
kredits-1
kredits-2
kredits-3
on hold
ops
question
security
ui/ux
wontfix
integration
btcpay
integration
discourse
integration
ejabberd
integration
email
integration
ldap
integration
lndhub
integration
mastodon
integration
nostr
integration
remotestorage
Something is not working
Graphic/visual design
Config, builds, CI, deployment, etc.
Documentation
This issue or pull request already exists
Improving existing functionality
New functionality
Dive in, and start contributing
Something to consider
Not a bug
Small contribution
Medium contribution
Large contribution
Currently not actionable
Manual IT ops activities
Looking for an answer
All your base are belong to us
User interface, process design, etc.
This won't be fixed
release
major
release
minor
release
patch
Milestone
No items
No Milestone
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: kosmos/akkounts#256
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Implements the optional OAuth 2.0 Authorization Code grant with PKCE (RFC 7636) for remoteStorage, per the remoteStorage spec §10.1. First of three PRs for #254.
What
rfc6749#section-3.1(authorization endpoint),rfc6749#section-3.2(token endpoint) andrfc7636=S256, and the advertised spec version is bumped todraft-dejong-remotestorage-27. The implicit endpoint (#section-4.2) is kept so non-PKCE clients keep working.rs_authorization_codestable storing only a SHA256 digest of the code, with a 5-minute expiry and single-use consumption.response_type=code, the consent dialog redirects back with?code=…(query), and a new cross-originPOST /rs/oauth/tokenexchanges the code +code_verifierfor a JSON access token after verifying the S256 challenge.The access token itself is still written to Redis exactly as before; Liquor Cabinet needs no change.
Interop
Verified against the current
remoteStorage.jsPKCE implementation, which reads exactly these WebFinger properties and sendsgrant_type=authorization_codewithcode/client_id/redirect_uri/code_verifierasapplication/x-www-form-urlencoded, expectingaccess_tokenin the JSON response.Notes
POST /rs/oauthremains the consent action;GET /rs/oauth/:usernameremains the dialog.Tests
bundle exec rspec— 335 examples, 0 failures (model, service, controller, request, feature and WebFinger specs added/updated).Follow-ups
user_agent).Part of #254.
0ab0412bb3to8fc7ffdd1dView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.