Skip to content

Commit

Permalink
Merge pull request #1579 from AzureAD/shahzaibj/merge-release-2.2.3-t…
Browse files Browse the repository at this point in the history
…o-master

Merge release 2.2.3 to master
  • Loading branch information
shahzaibj authored Jan 6, 2022
2 parents 6fd0fea + 4224106 commit 10db19e
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 5 deletions.
6 changes: 6 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
MSAL Wiki : https://github.com/AzureAD/microsoft-authentication-library-for-android/wiki

Version 2.2.3
----------
- Remove the broker check for MSA FRT saving function (#1571)
- Fix msal get account crash in Account Matcher due to NPE because account id was missing (#1558)
- Picks up [email protected]

Version 2.2.2
----------
- Picks up [email protected]
Expand Down
2 changes: 1 addition & 1 deletion common
Submodule common updated 16 files
+63 −5 azure-pipelines/templates/steps/maven-release/gpg-signing.sh
+1 −1 azure-pipelines/templates/steps/maven-release/maven-release-jobs.yml
+18 −0 changelog.txt
+122 −0 common/src/androidTest/java/com/microsoft/identity/common/MsalCppOAuth2TokenCacheTest.java
+33 −20 common/src/main/java/com/microsoft/identity/common/adal/internal/cache/StorageHelper.java
+152 −2 common/src/main/java/com/microsoft/identity/common/exception/IntuneAppProtectionPolicyRequiredException.java
+17 −10 common/src/main/java/com/microsoft/identity/common/internal/cache/MsalCppOAuth2TokenCache.java
+7 −0 ...ava/com/microsoft/identity/common/internal/commands/parameters/BrokerInteractiveTokenCommandParameters.java
+7 −6 common/src/main/java/com/microsoft/identity/common/internal/controllers/CommandDispatcher.java
+82 −22 common/src/main/java/com/microsoft/identity/common/internal/controllers/ExceptionAdapter.java
+3 −0 common/src/main/java/com/microsoft/identity/common/internal/providers/oauth2/AuthorizationFragment.java
+1 −0 common/src/main/java/com/microsoft/identity/common/internal/result/AdalBrokerResultAdapter.java
+3 −0 common/src/main/java/com/microsoft/identity/common/internal/result/BrokerResultAdapterFactory.java
+76 −0 common/src/main/java/com/microsoft/identity/common/internal/util/AccountUtil.java
+11 −0 common/src/main/java/com/microsoft/identity/common/internal/util/StringUtil.java
+1 −1 common/versioning/version.properties
4 changes: 2 additions & 2 deletions msal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,9 @@ dependencies {
transitive = false
}

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

distApi("com.microsoft.identity:common:3.6.3") {
distApi("com.microsoft.identity:common:3.6.7") {
transitive = false
}
}
Expand Down
25 changes: 25 additions & 0 deletions msal/src/main/java/com/microsoft/identity/client/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.microsoft.identity.common.internal.providers.microsoft.MicrosoftIdToken;
import com.microsoft.identity.common.internal.providers.microsoft.azureactivedirectory.AzureActiveDirectoryIdToken;
import com.microsoft.identity.common.internal.providers.oauth2.IDToken;
import com.microsoft.identity.common.internal.util.AccountUtil;
import com.microsoft.identity.common.internal.util.StringUtil;

import java.util.Map;
Expand All @@ -47,6 +48,7 @@ public class Account implements IAccount {
private String mHomeOid;
private String mHomeTenantId;
private String mEnvironment;
private String mHomeAccountId;

public Account(
@Nullable final String clientInfo,
Expand All @@ -69,6 +71,7 @@ void setId(@Nullable final String id) {
@NonNull
@Override
public String getId() {
final String methodName = ":getId";
String id;

ClientInfo clientInfo = null;
Expand All @@ -93,6 +96,24 @@ public String getId() {
id = mHomeOid;
}

if (StringUtil.isEmpty(id)) {
com.microsoft.identity.common.logging.Logger.warn(
TAG + methodName,
"Unable to get account id from either ClientInfo or IdToken. Attempting to obtain from home account id."
);
id = AccountUtil.getUIdFromHomeAccountId(mHomeAccountId);
}

if (StringUtil.isEmpty(id)) {
com.microsoft.identity.common.logging.Logger.error(
TAG + methodName,
"Account ID is empty. Returning MISSING_FROM_THE_TOKEN_RESPONSE.",
null
);

id = MISSING_FROM_THE_TOKEN_RESPONSE;
}

return id;
}

Expand Down Expand Up @@ -162,4 +183,8 @@ public String getAuthority() {

return MISSING_FROM_THE_TOKEN_RESPONSE;
}

public void setHomeAccountId(@NonNull final String homeAccountId) {
mHomeAccountId = homeAccountId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,8 @@ private static List<IAccount> createRootAccounts(
getIdToken(homeCacheRecord)
);

((MultiTenantAccount) rootAccount).setHomeAccountId(homeCacheRecord.getAccount().getHomeAccountId());

// Set the tenant_id
((MultiTenantAccount) rootAccount).setTenantId(
StringUtil.getTenantInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,9 @@ public String getMsaFamilyRefreshToken(@NonNull final String identifier) throws
@Override
public void saveMsaFamilyRefreshToken(@NonNull final String refreshToken) throws MsalClientException {
validateNonNullArgument(refreshToken, "refreshToken");
validateBrokerNotInUse();

// todo: Re-enable this when MSA SSO is fully supported by Broker (PRTv3)
//validateBrokerNotInUse();

try {
mTokenShareUtility.saveMsaFamilyRefreshToken(refreshToken);
Expand Down
2 changes: 1 addition & 1 deletion msal/versioning/version.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Wed Aug 01 15:24:11 PDT 2018
versionName=2.2.2
versionName=2.2.3
versionCode=0

0 comments on commit 10db19e

Please sign in to comment.