Skip to content

Commit 68e963e

Browse files
committed
Merge branch 'gradleVersionChange2' of https://github.com/AzureAD/microsoft-authentication-library-common-for-android into gradleVersionChange2
Pulling from msal\common to align with remote common repo
2 parents ae351b9 + 47633e2 commit 68e963e

107 files changed

Lines changed: 3033 additions & 587 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ For more information see the [Code of Conduct FAQ](https://opensource.microsoft.
2121
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
2222

2323
### Android Studio Build Requirement
24-
Please note that this project uses [Lombok](https://projectlombok.org/) internally and while using Android Studio you will need to install [Lobmok Plugin](https://plugins.jetbrains.com/plugin/6317-lombok) to get the project to build successfully within Android Studio.
24+
Please note that this project uses [Lombok](https://projectlombok.org/) internally and while using Android Studio you will need to install [Lombok Plugin](https://plugins.jetbrains.com/plugin/6317-lombok) to get the project to build successfully within Android Studio.

azure-pipelines/pull-request-validation/build-consumers.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ stages:
125125
displayName: Assemble msal
126126
inputs:
127127
jdkArchitecture: x64
128-
jdkVersionOption: "1.11"
128+
jdkVersionOption: "1.17"
129129
tasks: clean msal:assembleLocal
130130
- template: ../templates/steps/automation-cert.yml
131131
- task: Gradle@3
132132
displayName: Run msal Unit tests
133133
inputs:
134134
tasks: msal:testLocalDebugUnitTest -Plabtest -PlabSecret=$(LabVaultAppCert) -ProbolectricSdkVersion=${{variables.robolectricSdkVersion}} -PmockApiUrl=$(MOCK_API_URL)
135135
jdkArchitecture: x64
136-
jdkVersionOption: "1.11"
136+
jdkVersionOption: "1.17"
137137
# broker
138138
- job: brokerValidation
139139
displayName: Broker
@@ -169,13 +169,13 @@ stages:
169169
tasks: AADAuthenticator:clean AADAuthenticator:assembleLocal --build-cache --info
170170
publishJUnitResults: false
171171
jdkArchitecture: x64
172-
jdkVersionOption: "1.11"
172+
jdkVersionOption: "1.17"
173173
- task: Gradle@3
174174
displayName: Run broker Unit tests
175175
inputs:
176176
tasks: AADAuthenticator:localDebugAADAuthenticatorUnitTestCoverageReport --build-cache --info -Plabtest -PlabSecret=$(LabVaultAppCert) -ProbolectricSdkVersion=${{variables.robolectricSdkVersion}} -PpowerLiftApiKey=$(powerliftApiKey) -PcodeCoverageEnabled=true ${{variables.shouldSkipLongRunningTest}}
177177
jdkArchitecture: x64
178-
jdkVersionOption: "1.11"
178+
jdkVersionOption: "1.17"
179179
# Linux broker
180180
- job: linuxBrokerValidation
181181
displayName: Linux Broker
@@ -211,7 +211,7 @@ stages:
211211
tasks: LinuxBroker:clean LinuxBroker:assemble --build-cache --info
212212
publishJUnitResults: false
213213
jdkArchitecture: x64
214-
jdkVersionOption: "1.11"
214+
jdkVersionOption: "1.17"
215215
- task: Bash@3
216216
retryCountOnTaskFailure: 3
217217
displayName: Execute tests
@@ -264,10 +264,10 @@ stages:
264264
inputs:
265265
tasks: clean adal:assembleLocal
266266
jdkArchitecture: x64
267-
jdkVersionOption: "1.11"
267+
jdkVersionOption: "1.17"
268268
- task: Gradle@3
269269
displayName: Run adal Unit tests
270270
inputs:
271271
tasks: adal:testLocalDebugUnitTest -Plabtest -ProbolectricSdkVersion=${{variables.robolectricSdkVersion}} -PlabSecret=$(LabVaultAppCert)
272272
jdkArchitecture: x64
273-
jdkVersionOption: "1.11"
273+
jdkVersionOption: "1.17"

azure-pipelines/pull-request-validation/common.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
displayName: Assemble Local
3939
inputs:
4040
javaHomeSelection: JDKVersion
41-
jdkVersionOption: "1.11"
41+
jdkVersionOption: "1.17"
4242
tasks: clean common:assembleLocal
4343
publishJUnitResults: false
4444
jdkArchitecture: x64
@@ -48,14 +48,14 @@ jobs:
4848
displayName: Run Unit tests
4949
inputs:
5050
javaHomeSelection: JDKVersion
51-
jdkVersionOption: "1.11"
51+
jdkVersionOption: "1.17"
5252
tasks: common:testLocalDebugUnitTest -PlabSecret=$(LabVaultAppCert) -PmockApiUrl=$(MOCK_API_URL)
5353
- task: Gradle@3
5454
displayName: Check Dependencies size
5555
condition: eq(variables['system.pullRequest.targetBranch'], 'dev')
5656
inputs:
5757
tasks: common:dependenciesSizeCheck -PdependenciesSizeCheckConfig=distReleaseRuntimeClasspath
58-
jdkVersionOption: "1.11"
58+
jdkVersionOption: "1.17"
5959

6060
- job: spotbugs
6161
displayName: SpotBugs
@@ -68,6 +68,7 @@ jobs:
6868
- template: ../templates/steps/spotbugs.yml
6969
parameters:
7070
project: common
71+
7172
- job: lint
7273
displayName: Lint
7374
cancelTimeoutInMinutes: 1
@@ -87,5 +88,5 @@ jobs:
8788
tasks: clean common:lintLocalDebug
8889
publishJUnitResults: false
8990
javaHomeSelection: JDKVersion
90-
jdkVersionOption: "1.11"
91+
jdkVersionOption: "1.17"
9192
...

azure-pipelines/templates/steps/spotbugs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ steps:
1616
displayName: 'Run Spotbugs'
1717
inputs:
1818
javaHomeSelection: JDKVersion
19-
jdkVersionOption: "1.11"
19+
jdkVersionOption: "1.17"
2020
jdkArchitecture: x64
2121
cwd: ${{ parameters.cwd }}
2222
tasks: ${{ parameters.project }}:${{ parameters.spotbugsCommand }}

changelog.txt

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,33 @@
11
vNext
22
----------
3-
- [MINOR] Add suberror for network errors (#2537)
3+
- [MINOR] changed AGP version from 7.4.2 to 8.1.1 (#2584)
4+
- [PATCH] Fix Sign in Async method for sign in with google (#2583)
5+
- [MINOR] Add server client id to SignInWithGoogleParameters (#2581)
6+
- [MAJOR] Pass google id token to broker for enabling Sign in with Google (#2573)
7+
- [MINOR] Organize browser selection classes and change signature for get AuthorizationStrategy (#2564)
8+
- [MINOR] Add support for OneBox Environment (#2559)
9+
- [MINOR] Add support for claims requests for native authentication (#2572)
10+
- [MINOR] Removing unnecessary attributes from keystore wrap operation (#2578)
11+
12+
Version 19.0.1
13+
----------
14+
(common4j 16.0.1)
15+
- [PATCH] Span name added for corruption exception (#2574)
16+
17+
Version 19.0.0
18+
----------
19+
(common4j 16.0.0)
20+
- [MINOR] Add Sign in With Google component for MSA federation (#2551)
21+
- [MINOR] Add SDMBroadcastReceiver for applications to register callbacks for SDM broadcasts (#2547)
22+
- [MINOR] Add switch_browser toMicrosoftStsAuthorizationRequest (#2550)
23+
- [MAJOR] Add suberror for network errors (#2537)
424
- [PATCH] Translate MFA token error to UIRequiredException instead of ServiceException (#2538)
525
- [MINOR] Add Child Spans for Interactive Span (#2516)
626
- [MINOR] For MSAL CPP flows, match exact claims when deleting AT with intersecting scopes (#2548)
27+
- [MINOR] Replace Deprecated Keystore API for Android 28+ (#2558)
28+
- [MINOR] Managed profile Android util method (#2561)
29+
- [PATCH] Make userHandle response field optional (#2560)
30+
- [MINOR] Nonce redirect changes (#2552)
731

832
Version 18.2.2
933
----------

common-java-root/gradle.properties

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ org.gradle.daemon=true
1010

1111
# See https://stackoverflow.com/questions/56075455/expiring-daemon-because-jvm-heap-space-is-exhausted
1212
# we must make sure that the total size is <7G, as that's the RAM size of VM on the build pipeline.
13-
org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError
13+
#org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError
14+
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryError
1415

1516
# This the TSL versionName...
1617
versionName=1.5.9
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
3+
#distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-all.zip
5+
46
zipStoreBase=GRADLE_USER_HOME
57
zipStorePath=wrapper/dists

common/build.gradle

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ android {
6161
buildConfigField("boolean", "trustDebugBrokerFlag", "$trustDebugBrokerFlag")
6262
buildConfigField("boolean", "bypassRedirectUriCheck", "$bypassRedirectUriCheck")
6363
}
64-
64+
buildFeatures {
65+
buildConfig = true
66+
aidl = true
67+
}
6568
buildTypes {
6669
debug {
6770
testCoverageEnabled enableCodeCoverage
@@ -118,6 +121,7 @@ android {
118121
sourceSets {
119122
main {
120123
manifest.srcFile 'src/main/AndroidManifest.xml'
124+
aidl.srcDirs = ['src/main/aidl']
121125

122126
// Also load source from common-java
123127
java.srcDirs = ['src/main/java', 'src/main/kotlin']
@@ -170,6 +174,7 @@ dependencies {
170174
//needed for credentials support from play services, for devices running
171175
implementation "androidx.credentials:credentials-play-services-auth:$rootProject.ext.AndroidCredentialsVersion"
172176
implementation "com.google.android.gms:play-services-fido:$rootProject.ext.LegacyFidoApiVersion"
177+
implementation "com.google.android.libraries.identity.googleid:googleid:$rootProject.ext.GoogleIdVersion"
173178

174179
constraints {
175180
implementation ("com.squareup.okio:okio:3.4.0") {
@@ -239,15 +244,16 @@ android.libraryVariants.all { variant ->
239244
// Create tasks to generate javadoc jar
240245
android.libraryVariants.all { variant ->
241246
task("${variant.name}JavadocJar", type: Jar, dependsOn: "${variant.name}Javadoc") {
242-
classifier 'javadoc'
247+
archiveClassifier.set('javadoc')
243248
from tasks["${variant.name}Javadoc"].destinationDir
244249
}
245250
}
246251

247252

248253
tasks.register('sourcesJar', Jar) {
249254
from android.sourceSets.main.java.srcDirs
250-
classifier 'sources'
255+
// classifier 'sources'
256+
archiveClassifier.set('sources')
251257
destinationDirectory = reporting.file("$project.buildDir/outputs/jar/")
252258
}
253259

@@ -283,8 +289,8 @@ tasks.register('pmd', Pmd) {
283289
source = fileTree('src/main/java')
284290

285291
reports {
286-
xml.enabled = false
287-
html.enabled = true
292+
xml.required = false
293+
html.required = true
288294
}
289295
}
290296

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// All rights reserved.
3+
//
4+
// This code is licensed under the MIT License.
5+
//
6+
// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
// of this software and associated documentation files(the "Software"), to deal
8+
// in the Software without restriction, including without limitation the rights
9+
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
10+
// copies of the Software, and to permit persons to whom the Software is
11+
// furnished to do so, subject to the following conditions :
12+
//
13+
// The above copyright notice and this permission notice shall be included in
14+
// all copies or substantial portions of the Software.
15+
//
16+
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
// THE SOFTWARE.
23+
package com.microsoft.identity.common.internal.broker;
24+
25+
import android.content.Intent;
26+
27+
import androidx.test.core.app.ApplicationProvider;
28+
29+
import com.microsoft.identity.common.java.constants.SharedDeviceModeConstants;
30+
31+
import org.junit.Assert;
32+
import org.junit.Before;
33+
import org.junit.Test;
34+
import org.junit.runner.RunWith;
35+
import org.junit.runners.JUnit4;
36+
37+
@RunWith(JUnit4.class)
38+
public class SDMBroadcastReceiverTests {
39+
40+
String actualCallbackReceived;
41+
42+
@Before
43+
public void setup() {
44+
SDMBroadcastReceiver.initialize(ApplicationProvider.getApplicationContext(), new SDMBroadcastReceiver.SharedDeviceModeCallback() {
45+
@Override
46+
public void onSharedDeviceModeRegistrationStarted() {
47+
actualCallbackReceived = SharedDeviceModeConstants.BROADCAST_TYPE_SDM_REGISTRATION_START;
48+
}
49+
50+
@Override
51+
public void onSharedDeviceModeRegistered() {
52+
actualCallbackReceived = SharedDeviceModeConstants.BROADCAST_TYPE_SDM_REGISTERED;
53+
}
54+
55+
@Override
56+
public void onGlobalSignOut() {
57+
actualCallbackReceived = SharedDeviceModeConstants.BROADCAST_TYPE_GLOBAL_SIGN_OUT;
58+
}
59+
});
60+
}
61+
@Test
62+
public void testSDMBroadcast() throws InterruptedException {
63+
sendBroadcast(SharedDeviceModeConstants.BROADCAST_TYPE_SDM_REGISTRATION_START);
64+
Thread.sleep(100);
65+
Assert.assertEquals(SharedDeviceModeConstants.BROADCAST_TYPE_SDM_REGISTRATION_START, actualCallbackReceived);
66+
67+
sendBroadcast(SharedDeviceModeConstants.BROADCAST_TYPE_GLOBAL_SIGN_OUT);
68+
Thread.sleep(100);
69+
Assert.assertEquals(SharedDeviceModeConstants.BROADCAST_TYPE_GLOBAL_SIGN_OUT, actualCallbackReceived);
70+
}
71+
72+
private void sendBroadcast(String broadcastType) {
73+
final Intent intent = new Intent();
74+
intent.setAction(SharedDeviceModeConstants.CURRENT_ACCOUNT_CHANGED_BROADCAST_IDENTIFIER);
75+
intent.putExtra(SharedDeviceModeConstants.BROADCAST_TYPE_KEY, broadcastType);
76+
ApplicationProvider.getApplicationContext().sendBroadcast(intent);
77+
}
78+
}

common/src/main/java/com/microsoft/identity/common/adal/internal/AuthenticationConstants.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ public static final class Broker {
605605
*
606606
* @see <a href="https://identitydivision.visualstudio.com/DevEx/_git/AuthLibrariesApiReview?path=/%5BAndroid%5D%20Broker%20API/broker_protocol_versions.md">Android Auth Broker Protocol Versions</a>
607607
*/
608-
public static final String LATEST_MSAL_TO_BROKER_PROTOCOL_VERSION_CODE = "16.0";
608+
public static final String LATEST_MSAL_TO_BROKER_PROTOCOL_VERSION_CODE = "17.0";
609609

610610
/**
611611
* The maximum msal-to-broker protocol version known by clients such as MSAL Android.
@@ -1218,6 +1218,8 @@ public static String computeMaxHostBrokerProtocol() {
12181218
*/
12191219
public static final String COMPANY_PORTAL_APP_LAUNCH_ACTIVITY_NAME = Broker.COMPANY_PORTAL_APP_PACKAGE_NAME + ".views.SplashActivity";
12201220

1221+
public static final String SSO_NONCE_PARAMETER = "sso_nonce";
1222+
12211223
/**
12221224
* PRT nonce.
12231225
*/

0 commit comments

Comments
 (0)