Skip to content

Commit f1efb2e

Browse files
authored
Merge pull request #896 from AzureAD/release/1.2.0
Merge release/1.2.0 to master
2 parents d5ce860 + 76c76a2 commit f1efb2e

File tree

48 files changed

+690
-1110
lines changed

Some content is hidden

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

48 files changed

+690
-1110
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ It's simplest to create your configuration file as a "raw" resource file in your
7373
}
7474
```
7575

76+
>NOTE: In the `redirect_uri`, the part `<YOUR_PACKAGE_NAME>` refers to the package name returned by the `context.getPackageName()` method. This package name is the same as the [`application_id`](https://developer.android.com/studio/build/application-id) defined in your `build.gradle` file.
77+
7678
>NOTE: This is the minimum required configuration. MSAL relies on the defaults that ship with the library for all other settings. Please refer to the [configuration file documentation](https://docs.microsoft.com/azure/active-directory/develop/msal-configuration) to understand the library defaults.
7779
7880
### Step 3: Configure the AndroidManifest.xml

changelog

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

3+
Version 1.2.0
4+
------------
5+
- API change
6+
* Replaced the following PublicClientApplication#create methods.
7+
- create(context, clientId, listener)
8+
- create(context, clientId, authority, listener)
9+
with
10+
- create(context, clientId, authority, redirectUri, listener)
11+
- Fixed issue #850, #890.
12+
- Fixed issue #770 in common.
13+
- Return AndroidManifest config error in onError() instead of throwing a runtime exception.
14+
- Added Fragment support in WebView flow.
15+
316
Version 1.1.0-hf1
4-
- Fix issue #882
17+
------------
18+
- Fix issue #882.
519

620
Version 1.1.0
721
----------------------------
8-
- Expose id_token (raw) via IAccount/ITenantProfile from AuthenticationResult (#850)
22+
- Expose id_token (raw) via IAccount/ITenantProfile from AuthenticationResult (#850).
923

1024
Version 1.0.1
1125
----------------------------

common

Submodule common updated 55 files

msal/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ dependencies {
144144
transitive = false
145145
}
146146

147-
snapshotApi(group: 'com.microsoft.identity', name: 'common', version: '1.0.13-hf1', changing: true)
147+
snapshotApi(group: 'com.microsoft.identity', name: 'common', version: '1.0.14-SNAPSHOT', changing: true)
148148

149-
distApi("com.microsoft.identity:common:1.0.13-hf1") {
149+
distApi("com.microsoft.identity:common:1.0.14") {
150150
transitive = false
151151
}
152152
}

msal/src/androidTest/AndroidManifest.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
android:allowBackup="false">
1717
<uses-library android:name="android.test.runner" />
1818

19-
<activity
20-
android:name="com.microsoft.identity.client.AuthenticationActivity"
21-
android:configChanges="orientation|keyboardHidden|screenSize" />
2219
<activity android:name="com.microsoft.identity.client.TestActivity" />
2320

2421
<activity android:name="com.microsoft.identity.client.BrowserTabActivity">

msal/src/androidTest/java/com/microsoft/identity/client/AuthenticationActivityTest.java

Lines changed: 0 additions & 77 deletions
This file was deleted.

msal/src/androidTest/java/com/microsoft/identity/client/PublicClientApplicationTest.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import androidx.test.core.app.ApplicationProvider;
3838
import androidx.test.ext.junit.runners.AndroidJUnit4;
3939

40+
import com.microsoft.identity.client.exception.MsalClientException;
4041
import com.microsoft.identity.client.exception.MsalException;
4142
import com.microsoft.identity.client.internal.MsalUtils;
4243
import com.microsoft.identity.common.adal.internal.AuthenticationSettings;
@@ -75,7 +76,7 @@ public final class PublicClientApplicationTest {
7576
private Context mAppContext;
7677
private static final String CLIENT_ID = "client-id";
7778
private static final String[] SCOPE = {"scope1", "scope2"};
78-
public static final String TEST_AUTHORITY = "msauth://com.microsoft.identity.client.sample.local/signature";
79+
public static final String TEST_REDIRECT_URI = "msauth://com.microsoft.identity.client.sample.local/signature";
7980

8081
@Before
8182
public void setUp() {
@@ -217,20 +218,21 @@ public void onError(MsalException exception) {
217218
* Verify correct exception is thrown if callback is not provided.
218219
*/
219220
@Test(expected = IllegalArgumentException.class)
220-
public void testCallBackEmpty() throws PackageManager.NameNotFoundException {
221+
public void testCallBackEmpty() throws PackageManager.NameNotFoundException, MsalClientException {
221222
final Context context = new MockContext(mAppContext);
222223
mockPackageManagerWithClientId(context, null, CLIENT_ID);
223224
mockHasCustomTabRedirect(context);
224225
mockPackageManagerWithDefaultFlag(context);
225226

226227
final PublicClientApplicationConfiguration config = PublicClientApplicationConfigurationFactory.initializeConfiguration(context);
227-
config.mRedirectUri = TEST_AUTHORITY;
228-
final PublicClientApplication application = new PublicClientApplication(config, CLIENT_ID, null);
228+
config.setRedirectUri(TEST_REDIRECT_URI);
229+
config.setClientId(CLIENT_ID);
230+
final PublicClientApplication application = new PublicClientApplication(config);
229231
application.acquireToken(getActivity(context), SCOPE, null);
230232
}
231233

232234
@Test(expected = IllegalStateException.class)
233-
public void testInternetPermissionMissing() throws PackageManager.NameNotFoundException {
235+
public void testInternetPermissionMissing() throws PackageManager.NameNotFoundException, MsalClientException {
234236
final Context context = new MockContext(mAppContext);
235237
final PackageManager packageManager = context.getPackageManager();
236238
mockPackageManagerWithClientId(context, null, CLIENT_ID);
@@ -241,10 +243,10 @@ public void testInternetPermissionMissing() throws PackageManager.NameNotFoundEx
241243
Mockito.refEq(mAppContext.getPackageName()))).thenReturn(PackageManager.PERMISSION_DENIED);
242244

243245
PublicClientApplicationConfiguration config = PublicClientApplicationConfigurationFactory.initializeConfiguration(context);
244-
config.mTelemetryConfiguration = null;
245-
config.mRedirectUri = TEST_AUTHORITY;
246+
config.setRedirectUri(TEST_REDIRECT_URI);
247+
config.setClientId(CLIENT_ID);
246248

247-
new PublicClientApplication(config, CLIENT_ID, null);
249+
new PublicClientApplication(config);
248250
}
249251

250252
@Test
@@ -300,14 +302,15 @@ public void testB2cAuthorityNotInTrustedList() throws PackageManager.NameNotFoun
300302
}
301303

302304
@Test
303-
public void testSecretKeysAreSet() throws NoSuchAlgorithmException, InvalidKeySpecException {
305+
public void testSecretKeysAreSet() throws NoSuchAlgorithmException, InvalidKeySpecException, MsalClientException {
304306
final Context context = new MockContext(mAppContext);
305307
mockHasCustomTabRedirect(context);
306308
mockPackageManagerWithDefaultFlag(context);
307309

308310
final PublicClientApplicationConfiguration config = PublicClientApplicationConfigurationFactory.initializeConfiguration(context);
309-
config.mRedirectUri = TEST_AUTHORITY;
310-
final PublicClientApplication pca = new PublicClientApplication(config, CLIENT_ID, null);
311+
config.setRedirectUri(TEST_REDIRECT_URI);
312+
config.setClientId(CLIENT_ID);
313+
final PublicClientApplication pca = new PublicClientApplication(config);
311314
final PublicClientApplicationConfiguration appConfig = pca.getConfiguration();
312315

313316
SecretKeyFactory keyFactory = SecretKeyFactory

0 commit comments

Comments
 (0)