facebook authentication in phonegap for ios - ios

I'm trying to achieve following: I have facebook authentication on my web app. I want to return back to PhoneGap application after authentication is done.
The authentication flow works just fine. But returning to app should be done by providing a redirect url to facebook authentication URL. The problem is that I don't know what's the URL.
I've tried custom URL scheme, which works when authentication flow is executed in external Mobile Safari window. But in this case, the authentication is set to the Safari session, not for the Web App.
If external window is not used, but the authentication is done in Web App, the custom URL scheme won't work.
I have a hint this could be done with PhoneGap ChildBrowser plugin. That's the last possible option I want to try
If the only possible solution is ChildBrowser, I haven't found any good tutorial or instructions how this should be done. Any advice on that?
please give solution if any one have better example

Phonegap released a plugin for connecting to facebook: https://github.com/davejohnson/phonegap-plugin-facebook-connect

Related

google auth on electron app

We are developing an electron app using and reactjs and node. Google oauth2 is being used for signup and login. But we are not able to get back to the app after successful login. What is the right way to solve this. What is the return url that is to be given to return the user to the app?
Thanks in advance.
Ajey, I am also working in the same project. We are using the electron react boilerplate (https://github.com/chentsulin/electron-react-boilerplate) to build the application. We are not using any separate window for authentication. When click on the signin button, the application will redirect to the google authentication page and redirect to the url provided in the "redirect_uri" parameter.

How to deep-link directly to an app in Okta Mobile on iOS

We can send a link to someone formatted as okta:// and it will launch the Okta mobile app, but I would like to know if there is a way to deep link to a specific app in Okta mobile?
Something like okta://appname
or better yet would be okta://appname/specificpageinapp
I have tried all sorts of options, but none seem to work.
The Okta Mobile app doesn't support deep linking as you described.
You may be able to deep-link directly into native iOS applications using a similar URL Scheme (exampleapp://page/example). If the native iOS app is integrated with Okta, this might work as you expect.
However, it sounds like what you might actually want to do is link directly into the embedded web view of a web application in Okta. If that is the case, I suggest reaching out to Okta support with a feature request and the use case that you're trying to solve, so that it can get the attention of the product manager for the Okta Mobile app.

Issue with implementing "Login with Github" in iOS app

I am trying to understand how I can authenticate my iOS app using github. I understand from the documentation, that I need to implement this using OAuth.
I also understood that in my github profile, I need to register a new OAuth application, the form to do that looks like this:
I don't understand what info I have to provide for Homepage URL and Authorization callback URL as I am building an iOS app and not a webapp that is actually hosted on some server.
I would suggest trying FireBase. It has an infrastructure to enable GitHub login specifically. Also, there are sufficient examples to create the app.

How to get FirebaseSimpleLogin Facebook login working in a fullscreen/homescreen iOS Web App

I have an angular app that painlessly integrates with Firebase's SimpleLogin service for Facebook on the web, however, it relies on opening a pop-up to do so.
Although iOS 7.0.3 seems to have fixed some severe bugs where alerts and popups were not functional in fullscreen web apps (i.e. after 'Add to Homescreen'-ing a website via Safari), the Facebook login fails after redirecting to Facebook and granting approval, landing back on a blank page (which requires an app restart to remove).
I suspect this has something to do with the was Facebook is redirecting back, but AFAIK I don't have control over that, nor would hacks like these fix this.
Are there any workaround that exist for this problem?
[Engineer at Firebase] Support for redirect-based OAuth has been added to the Firebase Simple Login Web Client as of v1.3.0, available from the Firebase CDN or via Bower using bower install firebase-simple-login.
This update enables the Firebase Simple Login client to detect iOS "standalone" applications and handle the redirect-based OAuth automatically in your application.

Is it possible to call native ios Facebook login dialog from just a web page (not a web app)?

We have an ios app that uses native Facebook login just fine.
Then we also have a website (app is basically an optimized client for it) where people can login via Facebook too. When they open our website in mobile safari, they are directed to Facebook pages to authenticate there and it works, but.. it is still far from native and users have to retype credentials they often have in ios already.
So could it be possible to to somehow launch system fb authentication for just a web page (maybe using some clever URL schema?) and get granted token back to web?
Difficult way
As described here http://aaronparecki.com/articles/2012/07/29/1/oauth2-simplified#mobile-apps you could find URL scheme to trigger the native iOS app for app authorization:
fbauth://authorize?redirect_uri=[redirect_uri]&client_id=[client_id]&response_type=token
But if you call that link it's not possible to have a redirection. You could try to hack that redirection but maybe you could not find a way out.
A secure way to solve that problem is to use a SSO token to authenticate user on your App when he logs in, and next on Safari take a redirection, with a custom url to your APP, that do as bridge to FB App via Token stored in your APP. After FB authentication you can directly redirect user back to your landing page in Safari. As said by #Lego it's an alternative way to direct authenticate that could be made by going deep to custom URL used by FB.
No, it is not yet possible to directly authenticate the user via the native Facebook App, but it's possible to authenticate the user using a custom URL scheme which opens your native iOS app which then handles the authentication flow:
The user authenticates natively with your iOS App. You then store the user login (not password) in your app (i.e. using NSUserDefaults).
Then the user opens your web page in Mobile Safari. You redirect the user via a custom url scheme to your app (i.e. using myapp://authenticate). Apple documentation on implementing custom URL schemes: click
Now, if you have an active FB session in your iOS app, you can either directly redirect the user back to your landing page in Mobile Safari, passing the access token via url get parameter or you first re-authenticate the user, displaying a login view with the user name pre-filled, which you have stored in your iOS app before (step 1) and then redirect the user to your landing page, again all depending on session state and your security needs.
For opening face book app you can use Custom URL scheme. But i am not sure if u can authenticate user from it. In case if you could also then it will be confined up to the fb account which is already configured on that device app .so better try to use face book api or something
I don't get your question exactly but i think as per your question you want to create fb app Login in safari or in your custom web view.
is this perfect ?
as per my knowledge web view is different thing and native app is different thing.
if you are Login in web view then no need to check anything token or other thing because it will give you Logout thing there.
but if you are Login in your application then "developer.facebook.com" will definitely help you.
and yes, you will do most of the thing in your app as native facebook app do.
Hope it help....

Resources