-
Notifications
You must be signed in to change notification settings - Fork 5
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: Specify allowed schemes for redirect_uri parameter #175
Comments
There are actually implementations of RS clients in Web Extensions (Chrome/FF add-ons e.g.), which use a browser extension origin that is not HTTP. So this change would also break browser extension clients. |
Web servers can redirect to browser extension origins? That's new for me, I wonder whether that can be relied upon. It definitely requires using I solved this by redirecting to |
Yes, an HTTP response can redirect anywhere, and a user agent can decide to take you there. A browser extension origin also falls under the single-origin policy, same as other origins, and thus has its own sandboxed local storage, permissions, etc. |
FYI: At 5apps, we're currently working on a new UI for our remoteStorage accounts, and one new feature is that users can name the client when they authorize it first. The default name suggested will just be HTML |
Actually, it seems that there is even a Chrome API to do this: https://developer.chrome.com/extensions/identity#method-launchWebAuthFlow. That's what the WebVault extension is using. The "LessPass remoteStorage" extension will redirect to an author-owned URL instead. That's all the extensions with remoteStorage support I could find. |
I remember https://github.com/lesion/memm by @lesion. Forgot about the others. Interesting that they have an API for Chrome extensions for that now! We should probably document that in https://remotestoragejs.readthedocs.io/en/latest/ somewhere (and how to use it in extensions in general). |
Firefox supports it as well: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/identity. The documentation is confusing, but in the source code I can see that it will redirect to |
It also uses |
Cool. Personally, I don't see anything standing in the way of a pull request then. |
The spec says:
For this to be a good measure, the scheme of the
redirect_uri
parameter needs to be something where the origin is something meaningful. However, so far all servers I've seen which implement this part of the spec correctly (such as reStore) do not enforce particular schemes forredirect_uri
. This makesredirect_uri
values such asdata://google.com/,text
possible where google.com is considered the origin. Luckily, browsers usually will refuse to redirect to this URL.There is another aspect here: php-remote-storage, while failing to implement this part of the spec correctly, has the following line in its validation routine:
Should this ever be implemented, it would break most non-web clients.
I think that the spec should prevent such issues by explicitly stating: allowed schemes for
redirect_uri
are HTTP and HTTPS.The text was updated successfully, but these errors were encountered: