Inklings-io / selfauth

self-hosted auth_endpoint using simple login mechanism
Creative Commons Zero v1.0 Universal
81 stars 14 forks source link

Add support for scopes #19

Closed sebsel closed 7 years ago

sebsel commented 7 years ago

I see no quick way to implement this, so let me list the things that I think need to be done in order to support scopes.

First off: Selfauth is an Auth Endpoint and the Auth Endpoint only lists the scopes the App requests, and if the User agrees to them, they are passed along with the code to the Token Endpoint. People can work with tokens.indieauth.com/token for now. Issuing the tokens is currently out of scope for Selfauth.

Few points to fix before supporting scopes:

After that, we can exchange the current warning about supporting scopes to 'this is not a token endpoint, you can use tokens.indieauth.com for now', or something the like.

sebsel commented 7 years ago

From https://github.com/Inklings-io/selfauth/pull/16#discussion_r126312408: the regex should be something like @^[\x21\x23-\x5B\x5D-\x7E]+( [\x21\x23-\x5B\x5D-\x7E]+)*$@.

Zegnat commented 7 years ago

add the scope to the code when creating the code after successful password.

It should already be there. A code is expiry:hmac:data, in our use case the data is whatever scope value was given. So there are a few more checkboxes you can check 😉

Zegnat commented 7 years ago

All of this is now in the master branch! 🎉 Thanks for pushing for scope support, @sebsel!