Javascript Facebook Login Flow PWA - javascript

I'm using EmberJS to build a PWA that implements Facebook Login.
When it's used as a "installed" PWA Facebook SDK is not working and gives a blank page after permissions are given. So I had to implement Facebook Login Flow and everything was working until lst week.
var permissionUrl = "https://www.facebook.com/v2.8/dialog/oauth?client_id=CLIENTID&redirect_uri="+window.location.href+"&scope=email,public_profile";
window.location = permissionUrl;
This code only runs after checking if it's in "Standalone".
Now when I run the same thing in my Android phone it opens Facebook App, asks for permission and goes to de redirect but in a webview inside Facebook App.
The code was not changed from when it was working.
Any help would be much appreciated.

Related

Pop Up not redirecting after successful login into azure AD

I have implemented Azure AD with my web application. on clicking login window a pop up open with URL https://login.microsoftonline.com. it ask for Azure ad username and password, After successful login a code is return as parameter but pop up never route back to main page it just stays there.
Has anyone encountered this scenario?
This was working but stopped suddenly. Can there be a proxy issue or browser issue?
Many users have said that if you create a UserAgentApplication on the redirected page it will close the popup.
If you are using MSAL, you need to have the msal object instantiated in the page pointed to by the redirectUri, so that this object closes the popup.
You can also resolve this by using an SPFx extension on every page so the login popup is able to close. In the redirect URL (SPFx/AAD), you can specify the root site collection URL.
See related threads:
https://github.com/AzureAD/microsoft-authentication-library-for-js/issues/174
https://github.com/AzureAD/azure-activedirectory-library-for-js/issues/611
Angular Application stuck in an endless loop
I faced the same issue for SSO in Angular Project,
In my case, I created a wrong platform (i.e. Web).
Once I created a platform "Single-page application".
It worked fine for me.
I hope this might help someone.
Documentation URL for creating platform : https://learn.microsoft.com/en-us/azure/active-directory/develop/scenario-spa-app-registration
Documentation URL for angular integration : https://learn.microsoft.com/en-us/azure/active-directory/develop/tutorial-v2-angular-auth-code

social media login of my website not working in iphone

I'm using facebook and google plus login in my website and it is working fine at all devices except Iphone, I make a lot of searching I found that google has been block native apps from make authentication since 2017
update : the website I'm developing is a splash screen that opened to the user when he try to connect to cisco meraki access point to authenticate him and give him access to the internet ,
when an iphone mobile try to connect to the access point the splash screen opened in the native browser of it so the facebook and google plus buttons doesn't work
Do you have any suggestions or solutions about that issue?
I recently resolved this issue on a website I manage with these steps:
login to console.developers.google.com,
EDIT your APP, under;
Authorized JavaScript origins, and Authorized redirect URIs,
Enter:
http://yoursitenamehere.com
https://yoursitenamehere.com if it has ssl and
Save
Refresh your page and try to sign-in now.
For facebook:
sign-in to your facebook developers platform
under facebook login
go to Settings
Valid OAuth Redirect URIs
(after filling your app domain details, Copy and Paste the code below Ctrl&Shift V) https://example.com/?SuperSocializerAuth=Facebook (replace the example.com with the domain name you're activating social login for)

Home screen app (android) facebook login opens browser

I'm working on a website that is focused on mobile users and uses a manifest to be opened standalone when added to the home screen. This works well, except for the Facebook login function. Whenever I try to login it opens the Facebook link in the browser outside the app. I then have to manually return to the app and reload the page to be logged on.
How can I stay inside the standalone app when logging in?
I tried using window.location as explained in this popular answer but no change. I also tried using window.open as explained here but again, no luck.
You can try it on this test page that has an adjusted manifest and login option to stay inside the test page. I used a Samsung Galaxy S5 for testing.
You should not stay inside your app while logging.
Redirecting the user to the Identity provider (Facebook) in your case it is the normal life-cycle of an Oauth2 login or Single Sign On login. On the OAuth2 server you can set the redirect url which is the address you want the user to be send after login.
https://developers.facebook.com/docs/facebook-login/web#redirecturl
Login to your facebook app account: https://developers.facebook.com/apps and change the redirect url from your app control panel.

Can you communicate to a native mobile app from mobile web browser?

I want to find a way to run native mobile app, from a web app on a browser, and communicate the result back to it.
For example, how does Facebook user authentication work on a mobile device? You go to login with Facebook on a website. If on mobile, it opens the native Facebook app to do the authentication, and redirects the user back to the mobile web browser to open some page, post-authentication. Somehow, web browser and native application are able to communicate? Is there also any security risk to this?
One way to do this is as follows:
Use a custom url to launch the app from the website (see link below)
Pass whatever parameters you need to the app (for example a return web site URL in the case of a login authentication type app)
Once the app launches and does it thing, have the app launch a browser using the return address URL you passed as a parameter to the app.
A good, well maintained, link to using custom URL's and passing partakers to the App:
http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html

Facebook login for Windows app using Javascript and html5

I am developing a windows 8.1 app using javascript and html5. I want to integrate facebook login.When I searched I found the following documentations
1.https://developers.facebook.com/docs/facebook-login/login-for-windows-phone
2.https://developers.facebook.com/docs/facebook-login/login-flow-for-web/v2.3
which one should I use.
I suggest you go through the first link since it mentions how to integrate facebook SDK in windows phone. The other link mentions about Facebook integration through javascript in web.
I tried the first one, I used js function in wp8
Windows.System.Launcher.launchUriAsync("fbconnect://authorize?cliend_id=My_appId&scope=basic_info&redirect_uri=msft-my_prod_id://authorize").then(function (success){
})
It works for me, If I'm already logged with facebook app, it return true, else it show me Facebook Login Page. But I don't obtain Facebook userId, i'm able only to intercept boolean value for success or not. Did you get a solution for login and obtain Facebook userId?
I found the Winjs sdk for Facebook
https://github.com/Thuzi/facebook-winjs-sdk
it works for me.
For windows phone you need to use
Windows.Security.Authentication.Web.WebAuthenticationBroker.authenticateAndContinue instead of Windows.Security.Authentication.Web.WebAuthenticationBroker.authenticateAsync during the login

Categories

Resources