"Code" being placed before any hash in return URI - breaks ember apps at least

62 views
Skip to first unread message

rosele...@gmail.com

unread,
Nov 18, 2013, 2:53:56 AM11/18/13
to rack-...@googlegroups.com
Due to the way that ruby's URI module works, I think that this line: https://github.com/nov/rack-oauth2/blob/master/lib/rack/oauth2/util.rb#L37 might be behaving somewhat too naively.

If my return uri is on an Ember App, for instance, the url contains a hash before the end of the path, e.g. "localhost:8000/#/callback/"
everything after the first "#" is considered part of the url's "fragment."

Because of this, I get redirected to something like:


The code param gets passed in front of the "#" instead of at the end of the url. Because Ember requires the "#" to perform any routing, and my app is looking for a terminating "?key=value" query string, the form which the URL is directed to somewhat breaks the whole auth flow for me. Would it make sense to add a check for any forward-slashes following the hash, to make this line more supportive of apps that use this type of routing?

Any thoughts?

nov matake

unread,
Nov 18, 2013, 3:02:47 AM11/18/13
to rack-...@googlegroups.com
In such cases, use implicit flow (response_type=token) instead of code flow.
My gem doesn’t explicitly forbid using fragment components in redirect URIs, RFC6749 doesn’t allow such URIs though.
--
You received this message because you are subscribed to the Google Groups "Rack::OAuth2" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rack-oauth2...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages