Ionic Azure B2C Integration

#1

Hi,

I am new to Ionic and I am trying to integrate Ionic 3 app with our Azure AD B2C Solution. Can I get some help and some samples that can guide me how to integrate. Thanks in advance.

Thank You,
Roy

#2

Looking for the same answers information. Wondering if you’ve made any progress? I’m working on in an ionic app that uses an Azure website / web API and SQL database on the back end. Using AD B2C would be ideal but I’m not finding any viable examples.

#3

I didn’t find the solution yet. Keep me posted if you find anything.

#4

We are trying to get the same resolved. It works on the web but does not work in emulator or on device … any one got it working please post .

#5

​How did you get it working on Web. Can you please let me know which plugin
did you use (Which Cordova Plugin?) and if possible can you post a code
snippet please.

Thank You,
Roy​

#6

Hi, would you mind sharing how you made it work on the web? thanks!
Gustavo.

#7

We have made it working on the web and mobile to an extent. The fix was in msal 0.1.5 version’s UserAgentApplication.ts. Change the window.location.replace to window.open(url, “_blank”). This opens the response in the InAppBrowser.

However, we failed on routing to the app from the InBrowserApp url after the response with token is back from B2C. This keeps on failing with INVALID_URL_SCHEME. Any help is appreciated.

regards,
Narinder.

#8

We used the angular example - that is provided by Azure - https://github.com/Azure-Samples/active-directory-b2c-javascript-angular2.4-spa. (modified to our app id ) We are stuck with the redirection issue on android device or emulator. If we use Browsertab - we get 401 - bad request , If we use In app browser we get the token but the redirection fails.

1 Like
#9

i am using the
ionic-app-using-msalv015 sample
The problem i am having is the sample works fine to my MS Azure Tenant
If i do Ionic Serve…
logs in, get’s the token back… yay!

but, when i do the following, it doesn’t work
ionic cordova platform add iOS

once i run this. it doesn’t work

I am not sure how to set up a Tenant and App Authorization settings
to allow it to show the Login Window and return to the app…

any help would be appreciated

#10

I am stuck on redirection back to app.

Same here - works fine in web, but nothing happens when I click on social buttons like Facebook. I wonder if anyone had the same issue.

I am using MSAL javascript library (“msal”: “^0.1.7”)