44
Views
3
Comments
Solved
[MSAL Plugin] MSAL Broker
msal-plugin
Mobile icon
Forge asset by Walter Robins
Application Type
Mobile

Hello,

Could someone help me configure app to use Broker from this article.?

I want implement

I tried add this options, but without result = (

To app

{

    "preferences": {

            "android": [{

            "name": "AndroidXEnabled",

            "value": "true"

        }]

}

To plugin

{

"brokerRedirectUri": "true"

}

Also tried combine both configs in one

2020-01-23 12-22-46
kirill_code
Solution

I found answer for this topic.
To configure broker MSAL login without enter second factor in sourcese BrokerRedirectURI have to change to True:

In case if you use multiple accounts in same app change LoginPromt to Login


2020-01-23 12-22-46
kirill_code

Still stacked..

Tried change plugin.xml to add additional configs:

<preference name="CLIENT_ID" />

    <preference name="KEY_HASH" default="not-provided" />

    <preference name="msalUri"/>

    <platform name="android">

        <config-file target="res/xml/config.xml" parent="/*">

            <feature name="MsalPlugin">

                <param name="android-package" value="com.wrobins.cordova.plugin.MsalPlugin" />

                <preference name="tenantId" value="$TENANT_ID" />

                <preference name="clientId" value="$CLIENT_ID" />

                <preference name="keyHash" value="$KEY_HASH" />

                <preference name="msalUri" value="$msalUri" />


and MsalPlugin.java :

 data = "{\n" +

                                "    \"client_id\" : \"" + MsalPlugin.this.clientId + "\",\n" +

                                "    \"account_mode\": \"" + options.getString("accountMode") + "\",\n" +

                                "    \"authorization_user_agent\" : \"" + options.getString("authorizationUserAgent") + "\",\n" +

                                "    \"redirect_uri\" : \"msauth://" +MsalPlugin.this.msalUri + "\",\n" +

                                "    \"multiple_clouds_supported\": " + options.getBoolean("multipleCloudsSupported") + ",\n" +

                                "    \"broker_redirect_uri_registered\": " + MsalPlugin.this.brokerRedirectUri + ",\n" +

                                authorities.toString() +

                                "  }";

I have error:

No configuration has been set yet. Call msalInit() before calling this.SignInUserInteractive

But msalInit() locate in OnReady by default which before SignInUserInteractive in user workflow.


What can be wrong?

2020-01-23 12-22-46
kirill_code
Solution

I found answer for this topic.
To configure broker MSAL login without enter second factor in sourcese BrokerRedirectURI have to change to True:

In case if you use multiple accounts in same app change LoginPromt to Login


UserImage.jpg
Lakshay Verma

Hello,


I ma happy that you found a solution for this, I have stuck at same place.

I have set the Broker Redirect URI to True but I can still see the same error, any advise ?

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.