Firefox OAuth 2.0 Procedure

I am currently creating a javascript application for the new Firefox operating system and am focusing on how to implement the Google Drive API through OAuth v2. Perhaps the application is on

http://localhost and urn:ietf:wg:oauth:2.0:oob 

therefore, I have an installation client identifier for installed applications, as well as a client identifier for the Drive SDK. Since it is in the application, I turned on the browser (iframe) for OAuth, in which the user will provide access to the application, and refresh_token will be saved by the application and the user will be redirected to the application. There should not be a popup, and this should be contained in the application.

So how can I do this / what is the best way to do this since I do not have access to localhost and which method will be the best (e.g. jsclient, http request, ...)?

This application is simply client based (no server side). Another question: can a user enter their username and password in the application that we sent to Google for authorization?

+4
source share
3 answers

well, you can refer to the gaia calendar app , which use the google calendar calendar API.

EDIT: Read the recent OAuth thread discussion for packaged open web applications in the gaia-dev group

+2
source

See https://github.com/LDSorg/fxos-oauth2-jquery-demo for an example of an implicit grant strategy (browser only, no server).

manifest.json:

 { "name": "OAuth2 jQuery Demo" , "description": "Login using OAuth2 / OAuth3 with jQuery" , "version": "1.0" , "type": "privileged" , "launch_path": "/index.html" , "developer": { "name": "John Doe" , "url": "https://johndoe.com" } , "redirects": { "from": "http://should-be-a-fake-domain.com" , "to": "/oauth-close.html" } } 

Note:

There must be a privileged application:

 "type": "privileged" 

And the redirects should be in place:

 "redirects": { "from": "http://use-a-fake-domain.com/my-redirect" , "to": "/oauth-close.html" } 

Then you set redirect_uri to http://use-a-fake-domain.com . Of course, you could use your own domain - and you might need it if you canโ€™t add the fake domain to the whitelist of the supplierโ€™s domain that you are using - I just like to use the fake domain because it is a visual queue for me.

+1
source

I have the same question too. Do you have a better google auth solution in firefox os?

Firefox OS: Permission denied privileged application for accessing the "document" properties of a new window object created

0
source

Source: https://habr.com/ru/post/1482846/


All Articles