Skip to content

Commit 10db19e

Browse files
authored
Merge pull request #1579 from AzureAD/shahzaibj/merge-release-2.2.3-to-master
Merge release 2.2.3 to master
2 parents 6fd0fea + 4224106 commit 10db19e

File tree

7 files changed

+40
-5
lines changed

7 files changed

+40
-5
lines changed

changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
MSAL Wiki : https://github.com/AzureAD/microsoft-authentication-library-for-android/wiki
22

3+
Version 2.2.3
4+
----------
5+
- Remove the broker check for MSA FRT saving function (#1571)
6+
- Fix msal get account crash in Account Matcher due to NPE because account id was missing (#1558)
7+
8+
39
Version 2.2.2
410
----------
511

msal/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,9 @@ dependencies {
274274
transitive = false
275275
}
276276

277-
snapshotApi(group: 'com.microsoft.identity', name: 'common', version: '3.6.3', changing: true)
277+
snapshotApi(group: 'com.microsoft.identity', name: 'common', version: '3.6.7', changing: true)
278278

279-
distApi("com.microsoft.identity:common:3.6.3") {
279+
distApi("com.microsoft.identity:common:3.6.7") {
280280
transitive = false
281281
}
282282
}

msal/src/main/java/com/microsoft/identity/client/Account.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import com.microsoft.identity.common.internal.providers.microsoft.MicrosoftIdToken;
3232
import com.microsoft.identity.common.internal.providers.microsoft.azureactivedirectory.AzureActiveDirectoryIdToken;
3333
import com.microsoft.identity.common.internal.providers.oauth2.IDToken;
34+
import com.microsoft.identity.common.internal.util.AccountUtil;
3435
import com.microsoft.identity.common.internal.util.StringUtil;
3536

3637
import java.util.Map;
@@ -47,6 +48,7 @@ public class Account implements IAccount {
4748
private String mHomeOid;
4849
private String mHomeTenantId;
4950
private String mEnvironment;
51+
private String mHomeAccountId;
5052

5153
public Account(
5254
@Nullable final String clientInfo,
@@ -69,6 +71,7 @@ void setId(@Nullable final String id) {
6971
@NonNull
7072
@Override
7173
public String getId() {
74+
final String methodName = ":getId";
7275
String id;
7376

7477
ClientInfo clientInfo = null;
@@ -93,6 +96,24 @@ public String getId() {
9396
id = mHomeOid;
9497
}
9598

99+
if (StringUtil.isEmpty(id)) {
100+
com.microsoft.identity.common.logging.Logger.warn(
101+
TAG + methodName,
102+
"Unable to get account id from either ClientInfo or IdToken. Attempting to obtain from home account id."
103+
);
104+
id = AccountUtil.getUIdFromHomeAccountId(mHomeAccountId);
105+
}
106+
107+
if (StringUtil.isEmpty(id)) {
108+
com.microsoft.identity.common.logging.Logger.error(
109+
TAG + methodName,
110+
"Account ID is empty. Returning MISSING_FROM_THE_TOKEN_RESPONSE.",
111+
null
112+
);
113+
114+
id = MISSING_FROM_THE_TOKEN_RESPONSE;
115+
}
116+
96117
return id;
97118
}
98119

@@ -162,4 +183,8 @@ public String getAuthority() {
162183

163184
return MISSING_FROM_THE_TOKEN_RESPONSE;
164185
}
186+
187+
public void setHomeAccountId(@NonNull final String homeAccountId) {
188+
mHomeAccountId = homeAccountId;
189+
}
165190
}

msal/src/main/java/com/microsoft/identity/client/AccountAdapter.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ private static List<IAccount> createRootAccounts(
293293
getIdToken(homeCacheRecord)
294294
);
295295

296+
((MultiTenantAccount) rootAccount).setHomeAccountId(homeCacheRecord.getAccount().getHomeAccountId());
297+
296298
// Set the tenant_id
297299
((MultiTenantAccount) rootAccount).setTenantId(
298300
StringUtil.getTenantInfo(

msal/src/main/java/com/microsoft/identity/client/PublicClientApplication.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,9 @@ public String getMsaFamilyRefreshToken(@NonNull final String identifier) throws
12271227
@Override
12281228
public void saveMsaFamilyRefreshToken(@NonNull final String refreshToken) throws MsalClientException {
12291229
validateNonNullArgument(refreshToken, "refreshToken");
1230-
validateBrokerNotInUse();
1230+
1231+
// todo: Re-enable this when MSA SSO is fully supported by Broker (PRTv3)
1232+
//validateBrokerNotInUse();
12311233

12321234
try {
12331235
mTokenShareUtility.saveMsaFamilyRefreshToken(refreshToken);

msal/versioning/version.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#Wed Aug 01 15:24:11 PDT 2018
2-
versionName=2.2.2
2+
versionName=2.2.3
33
versionCode=0

0 commit comments

Comments
 (0)