PeterStaev / nativescript-azure-mobile-apps

:cloud: NativeScript plugin for working with Microsoft Azure Mobile Apps services
Apache License 2.0
30 stars 10 forks source link

Add 'ALLOWED EXTERNAL REDIRECT URLS' to the sample app for SafariViewController-powered login #13

Closed EddyVerbruggen closed 7 years ago

EddyVerbruggen commented 7 years ago

Hi!

I thought I'd chip in and upgrade this plugin to use SafariViewController login instead of the "in-app browser" as that's soon becoming mandatory on iOS.

I've got most of it working, the only thing that doesn't work is the redirect back to the app from the OAuth flow. That's supposed to work automagically if you add a little config to the Azure app.

So can you please add x-msauth-tns-azure-sample://easyauth.callback to the 'ALLOWED EXTERNAL REDIRECT URLS' field in these screenshots of the sample app?

Then I can test this feature and send a PR.

Thanks! Eddy

PeterStaev commented 7 years ago

Hey @EddyVerbruggen , I've just added this to the AAD settings: image

Please try it and let me know if it works. Thanks!

EddyVerbruggen commented 7 years ago

Thanks, that helped!

The most annoying bit is redirecting the user back to the app after the OAuth finishes. Azure's documentation on this subject is very poor (it's a new feature), but I've figured it out and am trying to find a not-too obtrusive way to integrate it with the neat code in your plugin.

Will do a PR soon.

cloudlene commented 6 years ago

Eddy, I'm trying to do exactly the same: "redirecting the user back to the app after the OAuth finishes. ". Yes, the "Azure's documentation on this subject is very poor (it's a new feature)," You said "but I've figured it out " and thought would ping you to know how you got this to work. I'm trying to add a AndroidManifest.xml to the res/native/android folder in the Apache Cordova Tools project. I figured I need to add "myapp://easyauth.callback" to metadata & map the redirect with an "intent-filter". Could you point me to the right syntax/method of doing this? Any help will be deeply appreciated. Thanks!

Jeremywhiteley commented 6 years ago

you need to add it to the AndroidManiftest.xml in this format from what I have read.

<data android:scheme="myapp" android:host="easyauth.callback" />

you also need to add the "myapp://easyauth.callback" to the call back in the allowed call backs URLS.