Tutorials for Ionic Android authenticated with Azure AD - android

Hi I am trying to build an app with
ionic5
Angular8
Capasitor
The webapp logs in fine. I used the example at https://github.com/AzureAD/microsoft-authentication-library-for-js.git but I can't get the android app to authenticate with Azure AD. On click of login it opens up a browser tab with a URL but the screen is blank.I was hoping to get some code examples for authentication.

In Cordova, Ionic and most of other hybrid mobile app development frameworks does not have most plugins to interact with the library needs to communicate with the native device constructs . Msal.js is designed to support authentication flows only for Single Page Applications and JS in web apps.
​
For supporting ASP.NET app authentication please look at Msal .Net. you could also move to Xamarin if you would really want to use MSAL. You could port your HTML app from cordova, remove all cordova plugins and references, and use a Hybrid Webview within Xamarin to achieve the same result.
​
​
​

We used https://github.com/moberwasserlechner/capacitor-oauth2. It works well for OAuth2.0 and OIDC with PKCE for web and mobile. We tested it for Azure AD and Okta.

Related

Sign in with Apple on Android with Cordova

I successfully implemented authentification with Apple ID on my ionic/cordova application for browser and iOS using firebase auth.
I would like to know if there is a way to allow my users to use this functionality on an Android device.
There is actually two native plugins for apple-sign-in with cordova :
cordova-signin-with-apple-plugin
cordova-plugin-sign-in-with-apple
But both are only compatible with ios.
According to the firebase apple-sign-in auth documentation, this can be achievable but require some android native code.
Does that mean that the only way to implement this on Cordova would be to create a native plugin ? Or is there another way ?
Thank you
Late reply but you need to use the Sign in with Apple JS flow, using the popup option. So from your webview you do the request to Apple first, then you send the Apple response to your server.
Have a look at the docs https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_js/configuring_your_webpage_for_sign_in_with_apple

Android/iOS: How to use existing microsoft account when using MSAL

When using MSAL library for authentication the app is redirecting the user to a webpage where they have to login with microsoft account. If the user already having Outlook or some other app installed then is there a way to get that login info like how FB app does it?
MSAL works best on iOS if the user has installed and configured the Microsoft Authenticator app. MSAL will launch that app instead of a web browser and the user can just tap their account to login.
If the device is managed by an MDM then you can [enable the enterprise SSO component>(https://github.com/AzureAD/microsoft-authentication-library-for-objc#microsoft-enterprise-sso-plug-in-for-apple-devices) to further simplify the login process.
Without the Authenticator app there is no way for your app to get any existing account authentication details.
Just a thought, but:
Azure AD messages are mostly standards based so you don't have to use MSAL libraries
You may get a better mobile solution with AppAuth libraries
Rather than a web page you could use the in app browser solutions, which feel integrated and have some good UX features:
Chrome Custom Tabs on Android
ASWebAuthenticationSession on iOS
In case any of this is useful, here are some links of mine, including code samples you can run:
Kotlin app for Android
SwiftUI app for iOS

Cordova app, authenticate WebView with native login

I have a Cordova application that I have built in Visual Studio 2015. Basically all this app does is host a webview of the URL of my main website which is built in MVC4 (it uses bootstrap so looks very much like an app on a mobile device).
What I am looking to do is explore methods of building a native login screen before loading my webview, this will accept a PIN code for quick access to their account.
Is there any way to persist authentication by logging them in with WebAPI and then feeding this session into the webview?

FB login for hybrid app

I am currently working on a hybrid mobile app with Worklight and HTML5 stack. This app required a FB login functionality. I have implemented FB login mechanism into my app with FB Js SDK. Works fine if I view it inside mobile browser simulator, but when I deploy this app to the physical device, FB login buttons and functionality are not available (literally, they disappear from view).
Also, I want to display my FB login form in the same view instead of pop up window.
I wonder if using FB Js SDK is a good approach for hybrid app's? Or maybe should I use native code to build login mechanism?
I've tried the same approach you used with facebook js sdk. It seems that "facebook js sdk" is for web apps and the site you are implementing have to be on a host. have you tried the cordova plugin for that? if you are using cordova,
try this one https://github.com/Wizcorp/phonegap-facebook-plugin
and another great solution is OpenFBwhich bypasses the js sdk.
and for your pop-up window problem try InAPPBrowser. But all of these are for cordova/Phonegap. But if you using another platform, I don't know any other solution rather than using JSONP to retrieve the fb login page over a remote host everytime you use the app.

How can facebook application integrate with iPhone/Android application?

If I have made a Facebook Application with php, can I integrate it with iPhone/Android or cross platform application so that I don't need to build another server/database and native code?
You can create a basic web service for your php application if you need it to communicate with a native-code app on Android or iOS. You should consider making a mobile web app on Facebook if you don't want to write native code. See https://developers.facebook.com/docs/guides/mobile/ for details on getting started.

Categories

Resources