Comments (15)
Please refer the iOS config section in README file, especially the Attention
note:
Attention: The value for CFBundleURLSchemes key should be the literal value of the Bundle Identifier with no $ variables, for example:
com.my-domain.native-app
So replace you variable with the string value and it should work
I will also replace misleading example in the README :)
from react-native-azure-auth.
Hey man thanks for answering. So I replaced both instances of the PRODUCT_BUNDLE_IDENTIFIER variable with the actual bundle identifiers, eg: com.example.myapp. So the key CFBundleURLSchemes now has "com.example.myapp" and CFBundleIdentifier also. Unfortunately I still have the same problem. Any ideas?
from react-native-azure-auth.
Try to double check your app registration in Azure portal. Remove all unrelated/unused redirect URIs and leave one according to schema in README
Also you could consult my comments to the issue #20
from react-native-azure-auth.
@advaniamobile Have you found a solution to the issue? I think I got the same problem. I get to the same screen and my app closes when I click on "Continue" or "Cancel"
from react-native-azure-auth.
@alexstoyanov No I haven't found a solution. After a lot of debugging I decided to try out a different library.
from react-native-azure-auth.
I have the same problem. When using it on Android, everything works fine, but on iOS I can't complete the login process. I have checked both the BundleIdentifier and the redirect url and they seem to be correct. I even created a new Azure app from scratch with only the redirect url of iOS, but it didn't work. Any clues why this may be happening?
from react-native-azure-auth.
Could you please post here following:
AzureAuth
initialization snippet...authorize()
call snippetCFBundleURLSchemes
andCFBundleIdentifier
sections of yourInfo.plist
- the callback URL as you have it in the App registration on Azure (please do the screenshot)
And the last thing: what type of MS account you are using to login? Eventually you have some restrictions related to callback URL
from react-native-azure-auth.
-
AzureAuth:
const azureAuth = new AzureAuth({ clientId: 'my-client-id', persistentCache: true, tenant: 'my-tenant', redirectUri: 'com.myapp.appios://com.myapp.appios/ios/callback' });
-
Authorize:
let tokens = await azureAuth.webAuth.authorize({scope: 'User.Read Calendars.ReadWrite Calendars.ReadWrite.Shared'});
-
CFBundleIdentifier:
<key>CFBundleIdentifier</key> <string>com.myapp.appios</string>
-
CFBundleURLSchemes:
<key>CFBundleURLSchemes</key> <array> <string>com.myapp.appios</string> </array>
-
My AppDelegate.m:
`#import <React/RCTLinkingManager.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url
sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
return [RCTLinkingManager application:application openURL:url
sourceApplication:sourceApplication annotation:annotation];
}
`
I'm using an educative or profesional account, but i don't think thats the issue since in Android works fine.
I have tried the url created in src/webAuth/index.js
for the login in the browser, but it's the same. It like the callback url it's no being called after the user logs in.
Also tried changing the callback url to https://login.microsoftonline.com/common/oauth2/nativeclient
and it was called after the login.
`const loginUrl = this.client.loginUrl(requestParams)
console.log(loginUrl)
let redirectUrl = await agent.openWeb(loginUrl)
//never reaches
console.log(redirectUrl);
`
from react-native-azure-auth.
- Try to remove
redirectUri
parameter fromnew AzureAuth(
, it is anyway default -
Also tried changing the callback url to https://login.microsoftonline.com/common/oauth2/nativeclient and it was called after the login.
Where you have done this? In the code or in the app registration?
If in the app registration and you have checked it in the browser - all correct. The problem is - you are doing login in the browser window called from the app, and then to return back to the app, the callback with the app-url-scheme should be called plus this url-scheme should be properly bound (registered) to the app. Therefor =>
- Double check this section:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>None</string>
<key>CFBundleURLName</key>
<string>AzureAuth</string>
<key>CFBundleURLSchemes</key>
<array>
<string>com.myapp.appios</string>
</array>
</dict>
</array>
Any typos, any not needed additions etc
- What iOS version are you on?
from react-native-azure-auth.
Thank you very much for the response.
-
I removed the
redirectUri
parameter and also thetenant
andpersistentCache
with the same result. -
Just used it to test that the Azure App was working, I changed it on the code and enabled the url in
Azure APP -> Authorization
. -
I revised my app
info.plist
to see if there were anything different with theCFBundleURLTypes
section, but I can't see what is wrong. Also tried changing the bundle identifier, theCFBundleTypeRole
or even adding theCFBundleURLTypes
thought xCode inInfo -> URL Types
but nothing worked. Should I check any other key that could be the problem? -
My app iOS target version is 9.0, and I'm running it on iOS 13 (Simulator 13.1 and On Device).
from react-native-azure-auth.
sorry for a long silence during holidays. I got also a new project at work and have unfortunately not too much time at the moment to answers quickly :)
- Have you replaced the bundle identifier in the project itself? File:
ios/<YOUR PROJECT>.xcodeproj
- Are you using the React Native Navigation? I found couple reported issues about conflicts with it. But it's only a subtile assumption...
- Are you using the latest RN version. For 0.60 was also reported a bug preventing the return to the app from browser login.
But the number 1) is my favorite ;)
from react-native-azure-auth.
Hi @vmurin
Thanks for your response. Just updated my project to the last version of react native (I was using a 0.59 version), and now the login flow is working as expected.
Thank you very much.
from react-native-azure-auth.
Perfekt! :)
Thank you for your feedback!
from react-native-azure-auth.
Hi,
I have the same problem in Android, iOS works fine, but it Android after a press continue or cancel both anything happens...
Someone can help me?
from react-native-azure-auth.
+1
from react-native-azure-auth.
Related Issues (20)
- 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 2
- I using redirect_uri = myapp://app when login auto bypass not show MFA
- Returned id_token could not be decoded HOT 8
- [Error: Not a valid base64 encoded string length] HOT 9
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.