I'm building an OAuth2 browser auth dialog in FxOS 2.0.0 and following the
instructions here:

https://developer.mozilla.org/en-US/Apps/Build/Manifest#redirects

"redirects": [
  {"from": "http://example.com/firefoxos-redirect.html";,
    "to": "/oauth-close.html"}
]


I've got it working on a regular browser perfectly. For the Firefox OS
version I swap out the real domain with the fake example.com as seen here:


var myAppId = '1234567890';
var myAppDomain = 'http://example.com/firefoxos-redirect.html';
var requestedScope = 'me';

var url = 'https://lds.io/oauth/dialog/authorize'
  + '?response_type=token'
  + '&client_id=' + myAppId
  + '&redirect_uri=' + myAppDomain + '?type=/auth/ldsconnect/callback/'
  + '&scope=' + encodeURIComponent(requestedScope)
  + '&state=' + Math.random().toString().replace(/^0./, '')
  ;

window.open(url, 'ldsconnectLogin', 'height=720,width=620');

But it never captures the redirect. It tries to go to example.com, which,
as we all know, doesn't exist.

Is there a working example app that shows how to do this? Or is there
something wrong here?

AJ ONeal
_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to