Comments (13)
Hi Alex,
the only reason that I can imagine is the wrong callback URI in the app registration. On iOS the SFSafariViewController is used to login. After successful login the "browser" window closes and should call registered callback URI. If there is no according registered URI found in the OS, then the window just closes and nothing happens.
So we have two places where the callback is registered:
- Azure portal app registration
- The
CFBundleURLSchemes
key in theInfo.plist
- see README
This two must be absolutely identical and contain NO any variables (with $ sign)
Please check this.
from react-native-azure-auth.
@vmurin Correct me if I am wrong - so if I have package name(Android) and Bundle ID(iOS) = com.example.app
The redirect URIs will be:
iOS -> com.example.app://com.example.app/ios/callback
Android -> com.example.app://com.example.app/android/callback
And the
CFBundleURLSchemes should be:
<key>CFBundleURLSchemes</key> <array> <string>com.example.app</string> </array>
EDIT: The section in README about redirect URIs is a little bit confusing. The iOS URI has variables as {} and ${}...
{YOUR_BUNDLE_IDENTIFIER}://${YOUR_BUNDLE_IDENTIFIER}/ios/callback
Android only {}. I am not sure what should be replaced ...
{YOUR_APP_PACKAGE_NAME}://{YOUR_APP_PACKAGE_NAME}/android/callback
from react-native-azure-auth.
-
All is correct. Do not forget to register both (Android and iOS) URIs in Azure
-
with the $ it was just a typo.
But as you followed the note 1
Make sure to replace {YOUR_BUNDLE_IDENTIFIER} and {YOUR_APP_PACKAGE_NAME} with the actual values for your application.
you are safe ;)
from react-native-azure-auth.
@vmurin OK, so I double checked all the data and it is the correct one. The strange thing is that even if I click cancel on the screen of the attachment the app is closed as on the GIF I attached earlier
from react-native-azure-auth.
@vmurin Also I checked the Info.plist in the example project to compare it to mine and it is missing the <key>CFBundleURLTypes</key> <array> <dict> <key>CFBundleTypeRole</key> <string>None</string> <key>CFBundleURLName</key> <string>AzureAuth</string> <key>CFBundleURLSchemes</key> <array> <string>com.my-domain.native-app</string> </array> </dict> </array>
part
from react-native-azure-auth.
OK. The next point that it could be is your company policy in Azure.
If in the OS the URL scheme registered correctly (we have checked this) then the reason could be, that the callback URL is not called on successful login.
I don't have any enterprise account, only private, so I can't help you and name exactly settings to check. Try to browse through and look what could be suspicious.
And can you check the behavior on Android emulator to compare?
from react-native-azure-auth.
It is working on Android emulator. I tried to run it on iOS device and now I have a crash report:
Last Exception Backtrace:
0 CoreFoundation 0x1b7e0498c __exceptionPreprocess + 220 (NSException.m:199)
1 libobjc.A.dylib 0x1b7b2d0a4 objc_exception_throw + 56 (objc-exception.mm:565)
2 CoreFoundation 0x1b7d06d1c +[NSException raise:format:arguments:] + 96 (NSException.m:146)
3 Foundation 0x1b813c8f4 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 128 (NSException.m:231)
4 UIKitCore 0x1bbe1a0f8 __58-[UIApplication _applicationOpenURLAction:payload:origin:]_block_invoke + 1136 (UIApplication.m:7111)
5 UIKitCore 0x1bbe19b24 -[UIApplication applicationOpenURLAction:payload:origin:] + 684 (UIApplication.m:7157)
6 SafariServices 0x1c7a905f0 -[SFSafariViewController remoteViewController:hostApplicationOpenURL:] + 568 (SFSafariViewController.m:586)
7 SafariServices 0x1c7a6eb94 -[SFBrowserRemoteViewController willOpenURLInHostApplication:] + 76 (SFBrowserRemoteViewController.m:159)
8 CoreFoundation 0x1b7e0ad90 invoking + 144
9 CoreFoundation 0x1b7cdabd0 -[NSInvocation invoke] + 300 (NSForwarding.m:3142)
10 libdispatch.dylib 0x1b7ad2184 _dispatch_client_callout + 16 (object.m:495)
11 libdispatch.dylib 0x1b7a7b038 _dispatch_block_invoke_direct$VARIANT$mp + 224 (queue.c:463)
12 FrontBoardServices 0x1bcee7540 FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 40 (FBSSerialQueue.m:173)
13 FrontBoardServices 0x1bcee720c -[FBSSerialQueue _queue_performNextIfPossible] + 404 (FBSSerialQueue.m:216)
14 FrontBoardServices 0x1bcee7734 -[FBSSerialQueue _performNextFromRunLoopSource] + 28 (FBSSerialQueue.m:247)
15 CoreFoundation 0x1b7d827e0 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24 (CFRunLoop.c:1922)
16 CoreFoundation 0x1b7d82738 __CFRunLoopDoSource0 + 80 (CFRunLoop.c:1956)
17 CoreFoundation 0x1b7d81ed0 __CFRunLoopDoSources0 + 180 (CFRunLoop.c:1992)
18 CoreFoundation 0x1b7d7d01c __CFRunLoopRun + 1080 (CFRunLoop.c:2882)
19 CoreFoundation 0x1b7d7c8bc CFRunLoopRunSpecific + 464 (CFRunLoop.c:3192)
20 GraphicsServices 0x1c1be8328 GSEventRunModal + 104 (GSEvent.c:2246)
21 UIKitCore 0x1bbe126d4 UIApplicationMain + 1936 (UIApplication.m:4753)
22 Shkolo 0x100823a60 main + 88 (main.m:16)
23 libdyld.dylib 0x1b7c07460 start + 4
Any idea?
from react-native-azure-auth.
@vmurin Also what about Info.plist I saw that in the example project you don't have CFBundleURLTypes CFBundleTypeRole None CFBundleURLName AzureAuth CFBundleURLSchemes com.my-domain.native-app
from react-native-azure-auth.
OK. The crash is good ;) it's something that explains the behavior.
About sample app project - I did not ran/tested it on the iOS, only Android. So the iOS part is not maintained properly.
Back to the crash:
- Did you checked the URL scheme on allowed characters? See README
- I don't have a Mac, but you can check some similar issues and try solutions proposed there.
Some random issue examples that I came across:
- facebookarchive/react-native-fbsdk#472
- AzureAD/microsoft-authentication-library-for-objc#268
- https://www.gitmemory.com/issue/proyecto26/react-native-inappbrowser/81/512708590
from react-native-azure-auth.
Stale issue closed due to inactivity
from react-native-azure-auth.
This issue happened to me too on ios both on attempt to log in and when cancelling just like the OP. However, I did get error message which indicated the problem was Linking.removeEventListener('url', urlHandler)
line where the error read undefined is not a function
.
Commenting that line out seems to have worked. @vmurin do you know why this line is causing the issue and can it be fixed in your library in the next version?
from react-native-azure-auth.
I'm getting the same exact error as @bibekgurunguh, looking at the the following code:
react-native-azure-auth/src/webauth/agent.js
Lines 15 to 19 in b304b4c
I'ts trying to reference
urlHandler
inside of itself, I don't think that would work 🤔from react-native-azure-auth.
Should be fixed in v1.8.5
from react-native-azure-auth.
Related Issues (20)
- Authentication IOS: Network request failed with face ID (IOS)
- ClearSession WebView iOS error when closing HOT 2
- Azure MFA Network Failure on iOS HOT 3
- Logout Redirect issue HOT 5
- First login attempt always fails HOT 3
- Expo Support HOT 1
- Logout WebView Not Closing HOT 3
- AcquireTokenSilent not working HOT 1
- [iOS] - Popup name edit HOT 2
- AcquireTokenSilent error - [TypeError: Cannot read property 'accessToken' of null] HOT 8
- i cant able to sign out from azuare ad. am usseing this in react native web
- Hide the address bar HOT 4
- Not able to change the authorityUrl/issuer using the authorize method HOT 11
- Data dog Rum is supported react native web ? HOT 1
- ClearSession is showing prompt to Sign In when user wants to Logout in iOS HOT 8
- Login screen is blank
- Is it possible to obtain the accessToken in JWT format? HOT 1
- Account login in app with lib not show MFA, but login with safari have MFA
- android stuck on "continue", does nothing HOT 6
- I using redirect_uri = myapp://app when login auto bypass not show MFA
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native-azure-auth.