I am building an Ionic App for both iOS and Android in which I am using inappbrowser to login to my server,After gaining access into the server when i close the inappbrowser and make a request to the same server from the app the request seem to be authorized if I use iOS device but in Android the request seem to be unauthorized.
my code looks like this
let browser = this.iab.create("myserver.com/login/","_blank","{hardwareback:'no',hidenavigationbuttons:'yes',closebuttoncaption:'close'}");
browser.on('exit').subscribe(event=>{
this.http.get("myserver.com/check_auth/",{},{}).then(res=>{
console.log(res.data) // true on ios, false for android
})
})
my backend is in Django.
Thanks in advance.
Related
I'm using Pusher for real chat application.
I've created a web app and a mobile app using Ionic 4.
The app use private channels, and everything works well on web enviroment.
During development i've tested the Ionic app on browser (ionic serve)
and the chat works very well.
When I tried to test the app on a real IOS Device (also XCode emulator),
i get an error in channel subscribtion
Unable to retrieve auth string from auth endpoint - received status 0 from https://...
I've tested the endpoint and works fine, even if I try to simulate the connection from the device as a simple API.
So I cannot understand where is the problem.
If I use a default channel (so no private) everything works fine also on IOS Device.
I'm thinking the problem should be on some Cordova/Ionic configuration?
Here's the code I use for Pusher setup and subscription (works if run on the browser with ionic)
this.pusher = new Pusher(this.environment.pusherKey, {
cluster: 'eu',
encrypted: true,
authEndpoint: this.mainService.hostEndpoint + 'user/pusherAuth',
});
this.pusher.subscribe(channelName)
Who's the hero who can help me solve this problem? :)
I don't want to rollback on the not a private channel just as a workaround for the problem.
for me i had the same issue and fixed that with adding 'Access-Control-Allow-Origin' header to my server response.
I developed an app in ionic 3. It's working fine for android & iOS. Then I added browser platform but fb & google login not working for it.
Ionic documentation http://ionicframework.com/docs/native/facebook/ says facebook plugin is supported in browser. But it's not working.
Google plus plugin only supports android & iOS.
So how to integrate fb & google login in PWA developed in ionic 3?
I have tried using angular4-social-login module but no luck. Also I tried using javascript sdk but no success.
Facebook with Browser:
After you add the browser platform:
ionic cordova platform add browser
ionic cordova build browser --prod
After that in your facebook develop website settings page, add your server's domain to app domain (or localhost for testing).
You can read more about it here: browser
I'm trying to implement Google auth for a web app built with Ionic 2.
I'm using Google Sign-In for Websites
and implemented as:
loginGoogle(referral: any) {
this.auth2.grantOfflineAccess().then((resp) => {
var auth_code = resp.code;
});
}
Using ionic serveI can sign-in without any issues.
If I deploy it as a browser app with ionic run browser it doesn't work and shows the following errors:
Can anybody tell how to overcome this error.
Thanks
firebase social login (Facebook &gmail) doesn't work with my android device
there is no response on clicking login button, however it works on localhost (web browser)........
..................
firebase social login doesn't work with my android device ,,works only on web !!
firebase social login doesn't work with my android device ,,works only on web !!
firebase social login doesn't work with my android device ,,works only on web !!
firebase social login doesn't work with my android device ,,works only on web !!
firebase social login doesn't work with my android device ,,works only on web !!
firebase social login doesn't work with my android device ,,works only on web !!
firebase social login doesn't work with my android device ,,works only on web !!
cordova plugin add cordova-plugin-inappbrowser
Just make sure you have inAppBrowser plugin installed. I think that is the reason
I'm trying to authorize app-users via google in an ionic app based on angularfire. The complete flow is working fine on my workstation's chrome browser (using ionic serve) but fails when deploying on my android device:
$authWithOAuthPopup, when used on Android (via 'ionic run', i.e. installed as apk) results in browser getting stuck in auth.firebase.com/blank/page.html.
All is working fine in html (via 'ionic serve') so I assume, that firebase and google configuration are fine. cordova.js is included properly.
The cordova inapp browser is installed and can open other urls. I have whitelisted firebase(io) and google domains and also allowed everything else. I am using cordova-plugin-inappbrowser 1.0.2-dev "InAppBrowser" and
cordova-plugin-whitelist 1.0.0 "Whitelist". I have tried older versions of the inappbrowser as well.
I am not using ionic livereload to avoid any potential cross-domain/proxy issues
When remote debugging, no errors are being reported: after $authWithOAuthPopup control gets lost somewhere deep in the minified firebase.js code and never returns to angularfire level
The following traffic is generated (detailed urls below):
1) firebase code calls auth.firebase.com/v2//auth/google, 2) accounts.google.com returns to 3)auth.firebase.com/v2.... which transfers to 4) auth.firebase.com/blank/page.html.
On the blank page I can see cookies.
Thanks for any advice in advance...
Detailed URLs from the webflow:
Initiator: firebase.js:147:
https: //auth.firebase.com/v2/gastrohub/auth/google?&v=js-2.2.6&transport=redirect&suppress_status_codes=true&requestId=p2k757pm4hsjv5531z7045voxcyuelsi0wt3&redirectTo=https%3A%2F%2Fauth.firebase.com%2Fblank%2Fpage.html
https: //accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=https%3A%2F%2Fauth.firebase.com%2Fv2%2Fgastrohub%2Fauth%2Fgoogle%2Fcallback&scope=%20profile&state=%7B%22firebase%22%3A%22gastrohub%22%2C%22requestId%22%3A%22p2k757pm4hsjv5531z7045voxcyuelsi0wt3%22%2C%22redirectTo%22%3A%22https%3A%2F%2Fauth.firebase.com%2Fblank%2Fpage.html%22%2C%22transport%22%3A%22redirect%22%2C%22v%22%3A%22js-2.2.6%22%7D&client_id=434498505800-p5rjvl6basvlsf4fh3t1ta9ej4pt2i28.apps.googleusercontent.com
https: //auth.firebase.com/v2/gastrohub/auth/google/callback?state=%7B%22firebase%22:%22gastrohub%22,%22requestId%22:%22p2k757pm4hsjv5531z7045voxcyuelsi0wt3%22,%22redirectTo%22:%22https://auth.firebase.com/blank/page.html%22,%22transport%22:%22redirect%22,%22v%22:%22js-2.2.6%22%7D&code=4/vgz4uJ8SgIswewKQHcMiXZbwddU_F9llfWKaRfEhOMI
https: //auth.firebase.com/blank/page.html