Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After the login via Chrome, the app is not launched back #9

Closed
oferRounds opened this issue Dec 4, 2018 · 3 comments
Closed

After the login via Chrome, the app is not launched back #9

oferRounds opened this issue Dec 4, 2018 · 3 comments
Labels

Comments

@oferRounds
Copy link

Is this have to do to with the manifest here:

 <data
      android:pathPrefix="/android/${applicationId}/callback"
      android:scheme="${applicationId}" 
 />

I get an error on the manifest which says that one host must be defined. Which host does it refer to?
Not sure...

@oferRounds
Copy link
Author

Ok, it’s not working! I think there’s a small mistake in the docs, it should be:

<data 
  android:scheme="${applicationId}"
  android:host="${applicationId}"
  android:pathPrefix="/android/callback" 
/>

@vmurin
Copy link
Owner

vmurin commented Dec 4, 2018

Please read the answer to this issue: #6
and pay attention to this hint in the README:

The applicationId here should be the same as your app package name, and not the ID from MS App Portal.

These points are only what does matter here.
It works definitely also without the android:host manifest attribute.
But I'm not sure why you was getting this error message.

@Monisankarnath
Copy link

Monisankarnath commented Feb 2, 2024

Guys I found the solution. So, when I created the app in azure b2c they asked to add package name and bundle_id_identifier for android and ios respectively. Depending on your naming it can be like com.project.demo or anything separate.
Now azure will provide us redirectUri from those and a hash as well for android.

Back in your react native project we need to add some configs for linking -
For IOS in info.plist file -

<dict>
        <key>CFBundleTypeRole</key>
    	<string>None</string>
    	<key>CFBundleURLName</key>
    	<string>AzureAuth</string>
    	<key>CFBundleURLSchemes</key>
       	<array>
          	<string>$(BUNDLE_ID_IDENTIFIER)</string>
        </array>
</dict>

For android in AndroidManifest.xml -

<intent-filter>
         <action android:name="android.intent.action.VIEW" />
          <category android:name="android.intent.category.DEFAULT" />
          <category android:name="android.intent.category.BROWSABLE" />
          <data android:scheme="msauth"
               android:host="com.project.demo"
               android:path="/hash"/> 
</intent-filter>

Now while azureAuth instance creation -

new AzureAuth({
      clientId: "xxxxxxxxx",
      redirectUri: Platform.select({android: redirect_uri_android, ios: redirect_uri_ios}),
      authorityUrl: 'abcd', // optional, to use the custom domain and deployed site
      tenant: "abcd",// optional, custom tenant
    });

This solved the problem with my recent setup. Hope it helps everyone. If anyone got any question you can connect with me through linkedin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants