Issue
i created a separate xamarin app and trying to fetch token after login. I am following code snippet similar to what is mentioned here
https://azure.microsoft.com/en-us/resources/samples/active-directory-b2c-xamarin-native/
in my Tenant settings are like this
my redirect URL is also formatted properly like
PCA.RedirectUri = $"msal{GlobalSetting.Instance.ClientID}://auth";
but
IEnumerable<IAccount> accounts = await App.PCA.GetAccountsAsync();
AuthenticationResult ar = await App.PCA.AcquireTokenAsync(GlobalSetting.Instance.Scopes, GetAccountByPolicy(accounts, GlobalSetting.Instance.PolicySignUpSignIn), App.UiParent);
this call takes me to Azure AD b2c pages and i have configured facebook there. After going through the facebook login it shows me the error
this big url and then "could not be loaded because net:ERR_UNKNOWN_URL_SCHEME"
my android manifest file looks like this
<application android:label="HaveThat" android:roundIcon="@mipmap/icon">
<application>
<activity android:name="microsoft.identity.client.BrowserTabActivity">
<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="msald6b07784-0e3a-483a-9exxxxxxc524ed1d" android:host="auth" />
</intent-filter>
</activity>
</application>
<provider android:name="android.support.v4.content.FileProvider" android:authorities="${applicationId}.fileprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths"></meta-data>
</provider>
</application>
UPDATE
after removing the inner application block its not showing the web page with error. instead it is showing a blank screen in my application and next line in the code is also not hitting.
Solution
fix was to use true as a second parameter in UIParent
App.UiParent = new UIParent(this, true);
this tells the system to use embedded browser.
Answered By - Raas Masood
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.