Closed Bug 1022748 Opened 6 years ago Closed 6 years ago

Include custom server URLs in Android Accounts.jsm launchSetup API

Categories

(Firefox for Android :: Android Sync, defect)

All
Android
defect
Not set

Tracking

()

RESOLVED FIXED
Firefox 33

People

(Reporter: nalexander, Assigned: nalexander)

References

Details

(Whiteboard: [qa+])

Attachments

(2 files)

This is the bug tracking making Android's Accounts.jsm include custom server URLs.
Whiteboard: [qa+]
ckarlof: this ticket is tracking modifying Accounts.jsm's launchSetup to include custom URLs.  I'll post a patch shortly.
Flags: needinfo?(ckarlof)
The accompanying add-on that works with this (screen capture to follow) is at

https://github.com/ncalexan/fxa-custom-server-addon

ckarlof: the JS API that the addon calls looks like

Accounts.launchSetup({auth:"url", services:{sync:"url"}});
Comment on attachment 8437960 [details] [diff] [review]
Part 1: Pass optional extras through Accounts.launchSetup. r=rnewman

Review of attachment 8437960 [details] [diff] [review]:
-----------------------------------------------------------------

::: mobile/android/base/BrowserApp.java
@@ +1124,5 @@
>              final Intent intent = new Intent(getContext(), FxAccountGetStartedActivity.class);
>              intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
> +            final NativeJSObject extras = message.optObject("extras", null);
> +            if (extras != null) {
> +                intent.putExtra("extras", extras.toString());

Too lazy to look it up: does toString do the right thing, or should this be toJSONString?
Attachment #8437960 - Flags: review?(rnewman) → review+
Comment on attachment 8437964 [details] [review]
Link to Github pull-request: https://github.com/mozilla-services/android-sync/pull/463

Notes in the pull request.
Attachment #8437964 - Flags: review?(rnewman) → review+
> ckarlof: the JS API that the addon calls looks like

> Accounts.launchSetup({auth:"url", services:{sync:"url"}});

I added some discussion here (Service Discovery API discussion) :

https://github.com/mozilla/fxa-auth-server/issues/738#issuecomment-46454827

about making authentication server configuration per-service. A default makes sense for when services don't want to delegate auth to specific service. 

"sync" vs "sync1.5"? I prefer "sync1.5".

It would be nice to support multiple urls for a service. E.g, in the "per-service auth delegation world", this might look something like: 

Accounts.launchSetup({ defaultAuth:"url", services: { sync1.5: { auth: "url", token: "url" }});
Flags: needinfo?(ckarlof)
(In reply to Chris Karlof [:ckarlof] from comment #7)
> > ckarlof: the JS API that the addon calls looks like
> 
> > Accounts.launchSetup({auth:"url", services:{sync:"url"}});
> 
> I added some discussion here (Service Discovery API discussion) :
> 
> https://github.com/mozilla/fxa-auth-server/issues/738#issuecomment-46454827
> 
> about making authentication server configuration per-service. A default
> makes sense for when services don't want to delegate auth to specific
> service. 
> 
> "sync" vs "sync1.5"? I prefer "sync1.5".
> 
> It would be nice to support multiple urls for a service. E.g, in the
> "per-service auth delegation world", this might look something like: 
> 
> Accounts.launchSetup({ defaultAuth:"url", services: { sync1.5: { auth:
> "url", token: "url" }});

This is an interesting idea, and worth pursuing, but doesn't represent how Android works at the moment.  Right now, there's only one auth server and it's a centralized system.  I'm making the call that we should reflect the situation on the ground for now, until we take concrete steps to change the auth model on Android, so I'm going to land without this defaultAuth/auth split.
https://hg.mozilla.org/mozilla-central/rev/9da481fd4b5d
https://hg.mozilla.org/mozilla-central/rev/e1f0b5ef74dc
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 33
Blocks: 1205801
Product: Android Background Services → Firefox for Android
You need to log in before you can comment on or make changes to this bug.