I'm currently developing a Firefox OS app wich should be caplable of saving files into my Dropbox account but I have some problems with the oauth2 authentication process. My app has to be "privileged", which means that all documents are not hosted on a webserver and so I need to use the "Dropbox.AuthDriver.Popup" driver for the authentication process.
My problem:
Everything works fine until Dropbox redirects me to the "oauth_receiver.html" which is hosted on my webserver. It seems that the " Dropbox.AuthDriver.Popup.oauthReceiver();" method can't send the authtoken to my app.
So is it possible to perfom a dropbox.js oauth2 authentication with the built-in auth drivers? Or do I need to do it by hand?
I was able to login to dropbox from a Firefox OS App using:
https://github.com/smarx/othw/tree/master/JavaScript
I did make a few changes. For example getting the redirect url. I changed it to the dropbox home:
function get_redirect_uri() {
return "https://www.dropbox.com/home";
}
I then used the redirects manifest (manifest.webapp for my app) setting like:
"redirects": [
{"from": "https://www.dropbox.com/home",
"to": "/redirects/auth.html"}
]
https://developer.mozilla.org/en-US/Apps/Build/Manifest#redirects
App had to be privileged btw. May not be the best way of doing it but it appears to work.
I also moved the js from inline to an external js file which I executed when a button was clicked. The auth.html file should have access to the token after the redirect.
Related
I have created a webapp where I use passport.js google strategy everything works well. the only problem is when I set display mode to standalone in manifest and then install the PWA app next time when I try to login using google Oauth the redirect callback link opens in pwa app and this break the login returns internal server error
How can I fix this everything works as expected in display mode browser
I'm making a React native app with expo and android emulator. I need to fetch my local api.
I have already succeed with an api running with docker on localhost:8989 (i had to put the local expo ip http://10.0.2.2 to reach localhost)
But here, i have site1.local , site2.local and api.local running on an apache server on localhost listening port80.
My three site are working with laravel and for further option:
http://localhost => 404 (only localhost/oauth/token reachable (because of passport)
http://site1.local ; http://site2.local ; http://api.local => all route reachables
How can i fetch theses site with expo ? If i put http://10.0.2.2/oauth/token it's working, but any other not working (404 error)
I'm kinda lost :(
If someone encounters this problem, this worked for me.
Use ngrok: ./ngrok http http://api.local, this makes a tunnel and your local site will be reachable via https.
U will obtain an address like: https://2186-2a06-4d12-1a7f.ngrok.io
The trick was to use this address in my .env by overwriting API_DOMAIN and the magic appeared in my expo project using this address, I'm able to make some request to my API.
I have a web application that can be installed as PWA. Once installed the problem appears on Android devices with Chrome.
If a user is logged out the application will redirect to an authentication service that is hosted on a separate server. Once a user has logged in the application redirect him to main page of app. PWA is opened automatically at this point. I don't want this.
Does anybody know a way to prevent automatically opening PWA when a user open a site in browser?
It was noticed on Android 8.0 with Google Chrome 74.0.3729.157.
Also if an authentication page is rendered inside iframe PWA is not opened automatically.
Finally I get it.
PWA is installed as WebAPK so Android open my application automatically when an auth server returns redirect to my application https://developers.google.com/web/fundamentals/integration/webapks.
A way exists to prevent that by defining a scope parameter in manifest.json. But it is not my case because all my application is in the root.
Finally I use iframe to render an auth page instead of redirection to auth service directly.
Submitted my app a few weeks ago and it got rejected, one of the problems was this:
Upon installing the app, I am being redirected to a non-embedded
version. When accessing the app from the installed apps list, the app
is redirecting to the embedded version. This occurs when an initial
OAuth request redirect fails to escape the iframe. Refer to our
embedded app OAuth doc. Please see this screencast for additional
details.
My app is working functionality-wise, and I've been able to test with a few client stores on an unlisted install.
The UI is hosted on a Google Cloud Bucket behind CloudFare for SSL and loads fine AFTER the initial install, when the user goes into the App Page in their admin dashboard -- it actually loads as an embedded app in an iframe.
The only issue is that on initial install, the UI loads the non-embedded version. I've tried a bunch of things with iframe escapes but nothing seems to be working.
I have been been working on an app in phonegap and make login and register with JavaScript and ajax call.
So I tested it on Google Chrome and it works perfect, connecting on server (mysql) and inserting data etc... So I decide to build app to test it on mobile (android), and it just not responding when I click on register or login button.
Is there some code or file which I need to import ?
Check the url you are connecting with in the ajax call, if its a full path
Application did not receive internet connection, so I changed my config.xml file.
Core plugins I found here: https://build.phonegap.com/plugins