fxa-client should not include scopes in the auth url params when we are authenticating in a "decoupled" state
Categories
(Application Services :: Fxa Client, enhancement)
Tracking
(Not tracked)
People
(Reporter: segun, Assigned: segun)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fxdroid] [android-activation-trust])
Attachments
(1 file)
As mentioned in Bug 2066516, to implement and fulfil fxa's ADR 0049, when authenticating in a "decoupled state", the auth URL returned by fxa-client as a result of BeginOAuthFlow or BeginPairingFlow events, must not contain the scope query param.
Currently, when an empty list is passed to the state machine through BeginOAuthFlow and BeginPairingFlow events from Android, the auth url returned looks like this:
https://accounts.firefox.com/authorization?...&service=sync&...&scope=&state...
and that breaks the auth web page with an error message that says:
Model Validation errors Encountered! Fields: An instance of kr has failed the validation:
- property scope has failed the following constraints: isNotEmpty
Not sure if this is all that might be required, but I believe that fxa-client needs to somehow know not to include scopes in the auth url it generates here - maybe we just send an empty list, or we might need a flag to tell fxa-client that we are authenticating in a decoupled world.
Comment 1•20 days ago
|
||
yeah - it looks like the server does get upset even with an empty scope list. It does seem like omitting it entirely when empty might solve it. It looks like we should probably refactor things a little - eg, begin_oauth_flow takes both service and scope params, with service stitched in before oauth_flow sees it - the component should probably be directly aware of the "rules" around service and scopes.
| Assignee | ||
Comment 2•20 days ago
|
||
(In reply to Mark Hammond [:markh] [:mhammond] from comment #1)
yeah - it looks like the server does get upset even with an empty scope list. It does seem like omitting it entirely when empty might solve it. It looks like we should probably refactor things a little - eg,
begin_oauth_flowtakes bothserviceandscopeparams, withservicestitched in beforeoauth_flowsees it - the component should probably be directly aware of the "rules" aroundserviceandscopes.
That is my impression as well. Although, I think we already handle it for service, we don't add it if it's empty - in begin_oauth_flow.
If you like, I can send a draft PR for your review/evaluation.
| Assignee | ||
Updated•9 days ago
|
Updated•9 days ago
|
| Assignee | ||
Comment 3•9 days ago
|
||
Comment 4•8 days ago
|
||
Authored by https://github.com/segunfamisa
https://github.com/mozilla/application-services/commit/5779a959e19d7e1251e369f8fc7ce12aeb18ebf2
[main] Bug 2074136 - Do not include scope query param in auth url when no scopes are specified (#7639)
(via GitHub webhook, authenticated as shared-secret)
Description
•