From 9a42a3c0ff8213e36ae5d63a216a01d8db3559a0 Mon Sep 17 00:00:00 2001 From: sgonzalezMSFT Date: Fri, 7 Jun 2019 10:09:54 -0700 Subject: [PATCH 01/16] Update B2C ROPC integration test to verify Id Token is returned --- .../java/com.microsoft.aad.msal4j/UsernamePasswordIT.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/UsernamePasswordIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/UsernamePasswordIT.java index 12e9c6d4..66dd9e84 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/UsernamePasswordIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/UsernamePasswordIT.java @@ -137,8 +137,7 @@ public void acquireTokenWithUsernamePassword_B2C_CustomAuthority() throws Except Assert.assertNotNull(result); Assert.assertNotNull(result.accessToken()); - // TODO uncomment once service fixes this for ROPC flow - // Assert.assertNotNull(result.idToken()); + Assert.assertNotNull(result.idToken()); } @Test @@ -164,7 +163,6 @@ public void acquireTokenWithUsernamePassword_B2C_LoginMicrosoftOnline() throws E Assert.assertNotNull(result); Assert.assertNotNull(result.accessToken()); - // TODO uncomment once service fixes this for ROPC flow - // Assert.assertNotNull(result.idToken()); + Assert.assertNotNull(result.idToken()); } } From 48b6e098167bbbf94db23249cd7fa4834bb0e5a1 Mon Sep 17 00:00:00 2001 From: Santiago Gonzalez <35743865+sangonzal@users.noreply.github.com> Date: Fri, 7 Jun 2019 16:14:15 -0700 Subject: [PATCH 02/16] Update README Update Javadoc link --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 27349190..a3862e39 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ `master` branch | `dev` branch | Reference Docs --------------------|-----------------|--------------- -[![Build status](https://identitydivision.visualstudio.com/IDDP/_apis/build/status/CI/Java/MSAL%20Java%20CI%20Build?branchName=master)](https://identitydivision.visualstudio.com/IDDP/_build/latest?definitionId=762) | [![Build status](https://identitydivision.visualstudio.com/IDDP/_apis/build/status/CI/Java/MSAL%20Java%20CI%20Build?branchName=dev)](https://identitydivision.visualstudio.com/IDDP/_build/latest?definitionId=762)| [![Javadocs](http://javadoc.io/badge/com.microsoft.azure/adal4j.svg)](http://javadoc.io/doc/com.microsoft.azure/adal4j) +[![Build status](https://identitydivision.visualstudio.com/IDDP/_apis/build/status/CI/Java/MSAL%20Java%20CI%20Build?branchName=master)](https://identitydivision.visualstudio.com/IDDP/_build/latest?definitionId=762) | [![Build status](https://identitydivision.visualstudio.com/IDDP/_apis/build/status/CI/Java/MSAL%20Java%20CI%20Build?branchName=dev)](https://identitydivision.visualstudio.com/IDDP/_build/latest?definitionId=762)| [![Javadocs](http://javadoc.io/badge/com.microsoft.azure/msal4j.svg)](http://javadoc.io/doc/com.microsoft.azure/msal4j) |[Getting Started](https://github.com/AzureAD/microsoft-authentication-library-for-java/wiki)| [Docs](https://aka.ms/aaddev)| [Support](README.md#community-help-and-support) | --- | --- | --- | @@ -43,4 +43,4 @@ If you find a security issue with our libraries or services please report it to ## We Value and Adhere to the Microsoft Open Source Code of Conduct -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. \ No newline at end of file +This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. From 44094dc08706302a3ec93ca4abe0d6839d6512ad Mon Sep 17 00:00:00 2001 From: sgonzalezMSFT Date: Thu, 13 Jun 2019 16:37:28 -0700 Subject: [PATCH 03/16] Add acquire token silent and remove accounts tests. Fix remove accounts bug --- .../AcquireTokenSilentIT.java | 171 ++++++++++++++++ .../AuthorizationCodeIT.java | 5 +- ...ationTest.java => CachePersistenceIT.java} | 8 +- .../ClientCredentialsIT.java | 2 +- .../DeviceCodeIT.java | 2 +- .../NationalCloudIT.java | 2 +- .../RefreshTokenIT.java | 2 +- .../TestConstants.java | 5 +- .../TokenCacheIT.java | 187 ++++++++++++++++++ .../UsernamePasswordIT.java | 2 +- .../java/labapi/KeyVaultSecretsProvider.java | 2 +- .../java/labapi/LabUserProvider.java | 13 +- .../com/microsoft/aad/msal4j/TokenCache.java | 9 +- .../com/microsoft/aad/msal4j/TestHelper.java | 18 +- .../cache_data/remove-account-test-cache.json | 0 15 files changed, 408 insertions(+), 20 deletions(-) create mode 100644 src/integrationtest/java/com.microsoft.aad.msal4j/AcquireTokenSilentIT.java rename src/integrationtest/java/com.microsoft.aad.msal4j/{CachePersistenceIntegrationTest.java => CachePersistenceIT.java} (98%) create mode 100644 src/integrationtest/java/com.microsoft.aad.msal4j/TokenCacheIT.java create mode 100644 src/test/resources/cache_data/remove-account-test-cache.json diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/AcquireTokenSilentIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/AcquireTokenSilentIT.java new file mode 100644 index 00000000..790e519d --- /dev/null +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/AcquireTokenSilentIT.java @@ -0,0 +1,171 @@ +package com.microsoft.aad.msal4j; + +import labapi.FederationProvider; +import labapi.LabResponse; +import labapi.LabUserProvider; +import labapi.NationalCloud; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.util.Collections; +import java.util.Set; + +public class AcquireTokenSilentIT { + private LabUserProvider labUserProvider; + + @BeforeClass + public void setUp() { + labUserProvider = LabUserProvider.getInstance(); + } + + @Test + public void acquireTokenSilent_OrganizationAuthority_TokenRefreshed() throws Exception { + + // When using common, organization, or consumer tenants, cache has no way + // of determining which access token to return therefore token is always refreshed + IPublicClientApplication pca = getPublicClientApplicationWithTokensInCache(); + + IAccount account = pca.getAccounts().join().iterator().next(); + SilentParameters parameters = SilentParameters.builder( + Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE), + account).build(); + + IAuthenticationResult result = pca.acquireTokenSilently(parameters).get(); + + Assert.assertNotNull(result); + Assert.assertNotNull(result.accessToken()); + Assert.assertNotNull(result.idToken()); + } + + @Test + public void acquireTokenSilent_LabAuthority_TokenNotRefreshed() throws Exception { + // Access token should be returned from cache, and not using refresh token + + LabResponse labResponse = labUserProvider.getDefaultUser( + NationalCloud.AZURE_CLOUD, + false); + String password = labUserProvider.getUserPassword(labResponse.getUser()); + String labAuthority = TestConstants.MICROSOFT_AUTHORITY_HOST + labResponse.getUser().getTenantId(); + + PublicClientApplication pca = new PublicClientApplication.Builder( + labResponse.getAppId()). + authority(labAuthority). + build(); + + IAuthenticationResult result = pca.acquireToken(UserNamePasswordParameters. + builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE), + labResponse.getUser().getUpn(), + password.toCharArray()) + .build()) + .get(); + + IAccount account = pca.getAccounts().join().iterator().next(); + SilentParameters parameters = SilentParameters.builder( + Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE), account). + build(); + + IAuthenticationResult acquireSilentResult = pca.acquireTokenSilently(parameters).get(); + + Assert.assertNotNull(acquireSilentResult.accessToken()); + Assert.assertNotNull(result.idToken()); + // Check that access and id tokens are coming from cache + Assert.assertEquals(result.accessToken(), acquireSilentResult.accessToken()); + Assert.assertEquals(result.idToken(), acquireSilentResult.idToken()); + } + + @Test + public void acquireTokenSilent_ForceRefresh() throws Exception { + + LabResponse labResponse = labUserProvider.getDefaultUser( + NationalCloud.AZURE_CLOUD, + false); + String password = labUserProvider.getUserPassword(labResponse.getUser()); + + PublicClientApplication pca = new PublicClientApplication.Builder( + labResponse.getAppId()). + authority(TestConstants.ORGANIZATIONS_AUTHORITY). + build(); + + IAuthenticationResult result = pca.acquireToken(UserNamePasswordParameters. + builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE), + labResponse.getUser().getUpn(), + password.toCharArray()) + .build()) + .get(); + + IAccount account = pca.getAccounts().join().iterator().next(); + SilentParameters parameters = SilentParameters.builder( + Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE), account). + forceRefresh(true). + build(); + + IAuthenticationResult resultAfterRefresh = pca.acquireTokenSilently(parameters).get(); + + Assert.assertNotNull(resultAfterRefresh); + Assert.assertNotNull(resultAfterRefresh.accessToken()); + Assert.assertNotNull(resultAfterRefresh.idToken()); + // Check that new refresh and id tokens are being returned + Assert.assertNotEquals(result.accessToken(), resultAfterRefresh.accessToken()); + Assert.assertNotEquals(result.idToken(), resultAfterRefresh.idToken()); + } + + @Test + public void acquireTokenSilent_MultipleAccountsInCache_UseCorrectAccount() throws Exception { + + IPublicClientApplication pca = getPublicClientApplicationWithTokensInCache(); + + // get lab user for different account + LabResponse labResponse = labUserProvider.getAdfsUser( + FederationProvider.ADFSV4, + true, + false); + String password = labUserProvider.getUserPassword(labResponse.getUser()); + + // acquire token for different account + pca.acquireToken(UserNamePasswordParameters. + builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE), + labResponse.getUser().getUpn(), + password.toCharArray()) + .build()) + .get(); + + Set accounts = pca.getAccounts().join(); + IAccount account = accounts.stream().filter( + x -> x.username().equalsIgnoreCase( + labResponse.getUser().getUpn())).findFirst().orElse(null); + + SilentParameters parameters = SilentParameters.builder( + Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE), account). + forceRefresh(true). + build(); + + IAuthenticationResult result = pca.acquireTokenSilently(parameters).get(); + + Assert.assertNotNull(result); + Assert.assertNotNull(result.accessToken()); + Assert.assertNotNull(result.idToken()); + Assert.assertEquals(result.account().username(), labResponse.getUser().getUpn()); + } + + private IPublicClientApplication getPublicClientApplicationWithTokensInCache() + throws Exception { + LabResponse labResponse = labUserProvider.getDefaultUser( + NationalCloud.AZURE_CLOUD, + false); + String password = labUserProvider.getUserPassword(labResponse.getUser()); + + PublicClientApplication pca = new PublicClientApplication.Builder( + labResponse.getAppId()). + authority(TestConstants.ORGANIZATIONS_AUTHORITY). + build(); + + pca.acquireToken(UserNamePasswordParameters. + builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE), + labResponse.getUser().getUpn(), + password.toCharArray()) + .build()) + .get(); + return pca; + } +} diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/AuthorizationCodeIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/AuthorizationCodeIT.java index 53500bb4..72dfe7cb 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/AuthorizationCodeIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/AuthorizationCodeIT.java @@ -41,7 +41,6 @@ import org.testng.util.Strings; import java.io.UnsupportedEncodingException; -import java.net.MalformedURLException; import java.net.URI; import java.net.URLEncoder; import java.util.Collections; @@ -247,7 +246,7 @@ private IAuthenticationResult acquireTokenInteractiveAAD( try { PublicClientApplication pca = PublicClientApplication.builder( labResponse.getAppId()). - authority(TestConstants.AUTHORITY_ORGANIZATIONS). + authority(TestConstants.ORGANIZATIONS_AUTHORITY). build(); result = pca.acquireToken(AuthorizationCodeParameters @@ -388,7 +387,7 @@ private String buildAuthenticationCodeURL(String appId, AuthorityType authorityT String authority; String scope; if(authorityType == AuthorityType.AAD){ - authority = TestConstants.AUTHORITY_ORGANIZATIONS; + authority = TestConstants.ORGANIZATIONS_AUTHORITY; scope = TestConstants.GRAPH_DEFAULT_SCOPE; } else { authority = TestConstants.B2C_AUTHORITY_URL; diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/CachePersistenceIntegrationTest.java b/src/integrationtest/java/com.microsoft.aad.msal4j/CachePersistenceIT.java similarity index 98% rename from src/integrationtest/java/com.microsoft.aad.msal4j/CachePersistenceIntegrationTest.java rename to src/integrationtest/java/com.microsoft.aad.msal4j/CachePersistenceIT.java index 9315dd8a..f607a201 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/CachePersistenceIntegrationTest.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/CachePersistenceIT.java @@ -28,12 +28,15 @@ import java.io.IOException; import java.net.URISyntaxException; -public class CachePersistenceIntegrationTest { +public class CachePersistenceIT { + static class TokenPersistence implements ITokenCacheAccessAspect{ + String data; + TokenPersistence(String data){ this.data = data; } - String data; + @Override public void beforeCacheAccess(ITokenCacheAccessContext iTokenCacheAccessContext){ iTokenCacheAccessContext.tokenCache().deserialize(data); @@ -44,6 +47,7 @@ public void afterCacheAccess(ITokenCacheAccessContext iTokenCacheAccessContext) data = iTokenCacheAccessContext.tokenCache().serialize(); } } + @Test public void cacheDeserializationSerializationTest() throws IOException, URISyntaxException { String dataToInitCache = TestHelper.readResource(this.getClass(), "/cache_data/serialized_cache.json"); diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java index 7211a4e2..367c2359 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java @@ -62,7 +62,7 @@ public void acquireTokenClientCredentials_ClientSecret() throws Exception{ private void assertAcquireTokenCommon(String clientId, IClientCredential credential) throws Exception{ ConfidentialClientApplication cca = new ConfidentialClientApplication.Builder( clientId, credential). - authority(TestConstants.AUTHORITY_MICROSOFT). + authority(TestConstants.MICROSOFT_AUTHORITY). build(); IAuthenticationResult result = cca.acquireToken(ClientCredentialParameters diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/DeviceCodeIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/DeviceCodeIT.java index 85837d95..a96b64d0 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/DeviceCodeIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/DeviceCodeIT.java @@ -64,7 +64,7 @@ public void DeviceCodeFlowTest() throws Exception { PublicClientApplication pca = new PublicClientApplication.Builder( labResponse.getAppId()). - authority(TestConstants.AUTHORITY_ORGANIZATIONS). + authority(TestConstants.ORGANIZATIONS_AUTHORITY). build(); Consumer deviceCodeConsumer = (DeviceCode deviceCode) -> { diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/NationalCloudIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/NationalCloudIT.java index 16dad92f..234865ad 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/NationalCloudIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/NationalCloudIT.java @@ -63,7 +63,7 @@ private void assertAcquireTokenCommon(NationalCloud cloud) throws Exception{ PublicClientApplication pca = new PublicClientApplication.Builder( labResponse.getAppId()). - authority(TestConstants.AUTHORITY_ORGANIZATIONS). + authority(TestConstants.ORGANIZATIONS_AUTHORITY). build(); IAuthenticationResult result = pca.acquireToken(UserNamePasswordParameters diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/RefreshTokenIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/RefreshTokenIT.java index e284975d..e9c78c21 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/RefreshTokenIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/RefreshTokenIT.java @@ -47,7 +47,7 @@ public void setUp() throws Exception { String password = labUserProvider.getUserPassword(labResponse.getUser()); pca = new PublicClientApplication.Builder( labResponse.getAppId()). - authority(TestConstants.AUTHORITY_ORGANIZATIONS). + authority(TestConstants.ORGANIZATIONS_AUTHORITY). build(); AuthenticationResult result = (AuthenticationResult)pca.acquireToken(UserNamePasswordParameters diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/TestConstants.java b/src/integrationtest/java/com.microsoft.aad.msal4j/TestConstants.java index 95423801..5f15c9fc 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/TestConstants.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/TestConstants.java @@ -28,8 +28,9 @@ public class TestConstants { public final static String GRAPH_DEFAULT_SCOPE = "https://graph.windows.net/.default"; public final static String B2C_LAB_SCOPE = "https://msidlabb2c.onmicrosoft.com/msaapp/user_impersonation"; - public final static String AUTHORITY_ORGANIZATIONS = "https://login.microsoftonline.com/organizations/"; - public final static String AUTHORITY_MICROSOFT = "https://login.microsoftonline.com/microsoft.onmicrosoft.com"; + public final static String MICROSOFT_AUTHORITY_HOST = "https://login.microsoftonline.com/"; + public final static String ORGANIZATIONS_AUTHORITY = MICROSOFT_AUTHORITY_HOST + "organizations/"; + public final static String MICROSOFT_AUTHORITY = MICROSOFT_AUTHORITY_HOST + "microsoft.onmicrosoft.com"; public final static String B2C_AUTHORITY = "https://msidlabb2c.b2clogin.com/tfp/msidlabb2c.onmicrosoft.com/"; public final static String B2C_AUTHORITY_URL = "https://msidlabb2c.b2clogin.com/msidlabb2c.onmicrosoft.com/"; diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/TokenCacheIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/TokenCacheIT.java new file mode 100644 index 00000000..76c1dc01 --- /dev/null +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/TokenCacheIT.java @@ -0,0 +1,187 @@ +package com.microsoft.aad.msal4j; + +import labapi.FederationProvider; +import labapi.LabResponse; +import labapi.LabUserProvider; +import labapi.NationalCloud; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import java.util.Collections; +import java.util.Set; + +public class TokenCacheIT { + + private LabUserProvider labUserProvider; + + @BeforeClass + public void setUp() { + labUserProvider = LabUserProvider.getInstance(); + } + + @Test + public void singleAccountInCache_RemoveAccountTest() throws Exception { + LabResponse labResponse = labUserProvider.getDefaultUser( + NationalCloud.AZURE_CLOUD, + false); + String password = labUserProvider.getUserPassword(labResponse.getUser()); + + PublicClientApplication pca = new PublicClientApplication.Builder( + labResponse.getAppId()). + authority(TestConstants.ORGANIZATIONS_AUTHORITY). + build(); + + // Check that cache is empty + Assert.assertEquals(pca.getAccounts().join().size() , 0); + + pca.acquireToken(UserNamePasswordParameters. + builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE), + labResponse.getUser().getUpn(), + password.toCharArray()) + .build()) + .get(); + + // Check that cache contains one account + Assert.assertEquals(pca.getAccounts().join().size(), 1); + + pca.removeAccount(pca.getAccounts().join().iterator().next()).join(); + + // Check that account has been removed + Assert.assertEquals(pca.getAccounts().join().size(), 0); + } + + @Test + public void twoAccountsInCache_RemoveAccountTest() throws Exception{ + + LabResponse labResponse1 = labUserProvider.getDefaultUser( + NationalCloud.AZURE_CLOUD, + false); + String password = labUserProvider.getUserPassword(labResponse1.getUser()); + + PublicClientApplication pca = new PublicClientApplication.Builder( + labResponse1.getAppId()). + authority(TestConstants.ORGANIZATIONS_AUTHORITY). + build(); + + Assert.assertEquals(pca.getAccounts().join().size() , 0); + + pca.acquireToken(UserNamePasswordParameters. + builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE), + labResponse1.getUser().getUpn(), + password.toCharArray()) + .build()) + .get(); + + Assert.assertEquals(pca.getAccounts().join().size() , 1); + + // get lab user for different account + LabResponse labResponse2 = labUserProvider.getAdfsUser( + FederationProvider.ADFSV4, + true, + false); + String password2 = labUserProvider.getUserPassword(labResponse1.getUser()); + + // acquire token for different account + pca.acquireToken(UserNamePasswordParameters. + builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE), + labResponse2.getUser().getUpn(), + password2.toCharArray()) + .build()) + .get(); + + Assert.assertEquals(pca.getAccounts().join().size(), 2); + + Set accounts = pca.getAccounts().join(); + IAccount accountLabResponse1 = accounts.stream().filter( + x -> x.username().equalsIgnoreCase( + labResponse1.getUser().getUpn())).findFirst().orElse(null); + + pca.removeAccount(accountLabResponse1).join(); + + Assert.assertEquals(pca.getAccounts().join().size() , 1); + + IAccount accountLabResponse2 = pca.getAccounts().get().iterator().next(); + + // Check that the right account was left in the cache + Assert.assertEquals(accountLabResponse2.username(), labResponse2.getUser().getUpn()); + } + + @Test + public void twoAccountsInCache_SameUserDifferentTenants_RemoveAccountTest() throws Exception{ + LabResponse labResponse = labUserProvider.getExternalUser(false); + String password = labUserProvider.getUserPassword(labResponse.getUser()); + + String dataToInitCache = TestHelper.readResource( + this.getClass(), + "/cache_data/remove-account-test-cache.json"); + + // check that cache is empty + Assert.assertEquals(dataToInitCache, ""); + + ITokenCacheAccessAspect persistenceAspect = new TokenPersistence(dataToInitCache); + + // acquire tokens for home tenant, and serialize cache + PublicClientApplication pca = new PublicClientApplication.Builder( + labResponse.getAppId()). + authority(TestConstants.ORGANIZATIONS_AUTHORITY) + .setTokenCacheAccessAspect(persistenceAspect) + .build(); + + pca.acquireToken(UserNamePasswordParameters. + builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE), + labResponse.getUser().getHomeUpn(), + password.toCharArray()) + .build()) + .get(); + + String guestTenantAuthority = TestConstants.MICROSOFT_AUTHORITY_HOST + labResponse.getUser().getTenantId(); + + // initialize pca with tenant where user is guest, deserialize cache, and acquire second token + PublicClientApplication pca2 = new PublicClientApplication.Builder( + labResponse.getAppId()). + authority(guestTenantAuthority). + setTokenCacheAccessAspect(persistenceAspect). + build(); + + pca2.acquireToken(UserNamePasswordParameters. + builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE), + labResponse.getUser().getHomeUpn(), + password.toCharArray()) + .build()) + .get(); + + // There should be two tokens in cache, with same accounts except for tenant + Assert.assertEquals(pca2.getAccounts().join().size() , 2); + + IAccount account = pca2.getAccounts().get().iterator().next(); + + // RemoveAccount should remove both cache entities + pca2.removeAccount(account).join(); + + Assert.assertEquals(pca.getAccounts().join().size() , 0); + + //clean up file + TestHelper.deleteFileContent( + this.getClass(), + "/cache_data/remove-account-test-cache.json"); + } + + private static class TokenPersistence implements ITokenCacheAccessAspect{ + String data; + + TokenPersistence(String data){ + this.data = data; + } + + @Override + public void beforeCacheAccess(ITokenCacheAccessContext iTokenCacheAccessContext){ + iTokenCacheAccessContext.tokenCache().deserialize(data); + } + + @Override + public void afterCacheAccess(ITokenCacheAccessContext iTokenCacheAccessContext) { + data = iTokenCacheAccessContext.tokenCache().serialize(); + } + } +} diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/UsernamePasswordIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/UsernamePasswordIT.java index 66dd9e84..066fdbb5 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/UsernamePasswordIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/UsernamePasswordIT.java @@ -97,7 +97,7 @@ public void assertAcquireTokenCommon(LabResponse labResponse, String password) throws Exception{ PublicClientApplication pca = new PublicClientApplication.Builder( labResponse.getAppId()). - authority(TestConstants.AUTHORITY_ORGANIZATIONS). + authority(TestConstants.ORGANIZATIONS_AUTHORITY). build(); IAuthenticationResult result = pca.acquireToken(UserNamePasswordParameters. diff --git a/src/integrationtest/java/labapi/KeyVaultSecretsProvider.java b/src/integrationtest/java/labapi/KeyVaultSecretsProvider.java index 53ebc064..b4952e95 100644 --- a/src/integrationtest/java/labapi/KeyVaultSecretsProvider.java +++ b/src/integrationtest/java/labapi/KeyVaultSecretsProvider.java @@ -67,7 +67,7 @@ private String requestAccessTokenForAutomation() { try{ ConfidentialClientApplication cca = ConfidentialClientApplication.builder( CLIENT_ID, getClientCredentialFromKeyStore()). - authority(TestConstants.AUTHORITY_MICROSOFT). + authority(TestConstants.MICROSOFT_AUTHORITY). build(); result = cca.acquireToken(ClientCredentialParameters diff --git a/src/integrationtest/java/labapi/LabUserProvider.java b/src/integrationtest/java/labapi/LabUserProvider.java index f85765ed..873edc74 100644 --- a/src/integrationtest/java/labapi/LabUserProvider.java +++ b/src/integrationtest/java/labapi/LabUserProvider.java @@ -86,6 +86,17 @@ public LabResponse getB2cUser(B2CIdentityProvider b2CIdentityProvider, return getLabUser(query); } + public LabResponse getExternalUser(boolean useBetaEndpoint){ + UserQuery query = new UserQuery.Builder(). + isExternalUser(true). + isMamUser(false). + isMfaUser(false). + isFederatedUser(false). + useBetaEnpoint(useBetaEndpoint). + build(); + return getLabUser(query); + } + // MSA users are not exposed in lab users API. Have to get them directly from keyvault. public LabResponse getMsaUser(){ String userName = keyVaultSecretsProvider.getSecret(LabConstants.USER_MSA_USERNAME_URL); @@ -98,7 +109,7 @@ public LabResponse getMsaUser(){ return new LabResponse(LabConstants.MSA_APP_ID, user); } - private LabResponse getLabUser(UserQuery userQuery){ + public LabResponse getLabUser(UserQuery userQuery){ if(userCache.containsKey(userQuery)){ return userCache.get(userQuery); } diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenCache.java b/src/main/java/com/microsoft/aad/msal4j/TokenCache.java index e8b54a76..3aaf8914 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenCache.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenCache.java @@ -118,11 +118,14 @@ private static void mergeRemovals(JsonObject old, JsonObject update) { JsonObject oldEntries = old.getAsJsonObject(msalEntity); JsonObject newEntries = update.getAsJsonObject(msalEntity); if(oldEntries != null){ - for (Map.Entry oEntry : oldEntries.entrySet()) - { + Iterator> iterator = oldEntries.entrySet().iterator(); + + while(iterator.hasNext()){ + Map.Entry oEntry = iterator.next(); + String key = oEntry.getKey(); if(newEntries == null || !newEntries.has(key)){ - oldEntries.remove(key); + iterator.remove(); } } } diff --git a/src/test/java/com/microsoft/aad/msal4j/TestHelper.java b/src/test/java/com/microsoft/aad/msal4j/TestHelper.java index cec45ba9..d465b7a1 100644 --- a/src/test/java/com/microsoft/aad/msal4j/TestHelper.java +++ b/src/test/java/com/microsoft/aad/msal4j/TestHelper.java @@ -23,16 +23,28 @@ package com.microsoft.aad.msal4j; +import java.io.File; +import java.io.FileWriter; import java.io.IOException; import java.net.URISyntaxException; import java.nio.file.Files; import java.nio.file.Paths; -public class TestHelper { +class TestHelper { - static String readResource(Class classIntance, String resource) throws IOException, URISyntaxException { + static String readResource(Class classInstance, String resource) throws IOException, URISyntaxException { return new String( Files.readAllBytes( - Paths.get(classIntance.getResource(resource).toURI()))); + Paths.get(classInstance.getResource(resource).toURI()))); + } + + static void deleteFileContent(Class classInstance, String resource) + throws URISyntaxException, IOException { + FileWriter fileWriter = new FileWriter( + new File(Paths.get(classInstance.getResource(resource).toURI()).toString()), + false); + + fileWriter.write(""); + fileWriter.close(); } } diff --git a/src/test/resources/cache_data/remove-account-test-cache.json b/src/test/resources/cache_data/remove-account-test-cache.json new file mode 100644 index 00000000..e69de29b From 2632e38a843b26b2259b53572ba37faff00e3603 Mon Sep 17 00:00:00 2001 From: Santiago Gonzalez Date: Thu, 13 Jun 2019 17:12:00 -0700 Subject: [PATCH 04/16] Add license headers --- .../AcquireTokenSilentIT.java | 23 +++++++++++++++++++ .../TokenCacheIT.java | 23 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/AcquireTokenSilentIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/AcquireTokenSilentIT.java index 790e519d..fc00126a 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/AcquireTokenSilentIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/AcquireTokenSilentIT.java @@ -1,3 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package com.microsoft.aad.msal4j; import labapi.FederationProvider; diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/TokenCacheIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/TokenCacheIT.java index 76c1dc01..44ee857e 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/TokenCacheIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/TokenCacheIT.java @@ -1,3 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package com.microsoft.aad.msal4j; import labapi.FederationProvider; From 7ab0fccb0e619b34fe169ab1e928bb20665b0fdd Mon Sep 17 00:00:00 2001 From: sgonzalezMSFT Date: Mon, 17 Jun 2019 14:24:20 -0700 Subject: [PATCH 05/16] Upate to use fluent API --- .../microsoft/aad/msal4j/ADFSAuthority.java | 23 ++++++++++ ...uireTokenByAuthorizationGrantSupplier.java | 10 ++-- .../AcquireTokenByDeviceCodeFlowSupplier.java | 2 +- .../aad/msal4j/AppMetadataCacheEntity.java | 23 ++++++++++ .../aad/msal4j/AsymmetricKeyCredential.java | 23 ++++++---- .../aad/msal4j/AuthenticationException.java | 9 ++-- .../msal4j/AuthenticationResultSupplier.java | 2 +- .../com/microsoft/aad/msal4j/Authority.java | 23 ++++++++++ .../microsoft/aad/msal4j/B2CAuthority.java | 23 ++++++++++ .../aad/msal4j/ClaimsChallengeException.java | 20 ++++---- .../microsoft/aad/msal4j/ClientAssertion.java | 43 +++-------------- .../microsoft/aad/msal4j/ClientSecret.java | 46 +++++-------------- .../msal4j/ConfidentialClientApplication.java | 6 +-- .../com/microsoft/aad/msal4j/JwtHelper.java | 4 +- .../com/microsoft/aad/msal4j/PublicApi.java | 2 +- .../microsoft/aad/msal4j/StringHelper.java | 4 -- .../aad/msal4j/UserDiscoveryRequest.java | 4 +- .../aad/msal4j/UserDiscoveryResponse.java | 25 ++-------- .../microsoft/aad/msal4j/WSTrustResponse.java | 4 +- .../microsoft/aad/msal4j/WSTrustVersion.java | 14 +++--- .../aad/msal4j/DeviceCodeFlowTest.java | 2 +- .../aad/msal4j/TokenRequestTest.java | 2 +- 22 files changed, 168 insertions(+), 146 deletions(-) diff --git a/src/main/java/com/microsoft/aad/msal4j/ADFSAuthority.java b/src/main/java/com/microsoft/aad/msal4j/ADFSAuthority.java index 01a138e4..59baa974 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ADFSAuthority.java +++ b/src/main/java/com/microsoft/aad/msal4j/ADFSAuthority.java @@ -1,3 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package com.microsoft.aad.msal4j; import java.net.URL; diff --git a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByAuthorizationGrantSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByAuthorizationGrantSupplier.java index 90209de2..6185e9b2 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByAuthorizationGrantSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByAuthorizationGrantSupplier.java @@ -94,10 +94,10 @@ private OAuthAuthorizationGrant processPasswordGrant( if (userDiscoveryResponse.isAccountFederated()) { WSTrustResponse response = WSTrustRequest.execute( - userDiscoveryResponse.getFederationMetadataUrl(), + userDiscoveryResponse.federationMetadataUrl(), grant.getUsername(), grant.getPassword().getValue(), - userDiscoveryResponse.getCloudAudienceUrn(), + userDiscoveryResponse.cloudAudienceUrn(), msalRequest.requestContext(), this.clientApplication.getServiceBundle(), this.clientApplication.logPii()); @@ -136,10 +136,10 @@ private AuthorizationGrant getAuthorizationGrantIntegrated(String userName) thro this.clientApplication.getServiceBundle()); if (userRealmResponse.isAccountFederated() && - "WSTrust".equalsIgnoreCase(userRealmResponse.getFederationProtocol())) { + "WSTrust".equalsIgnoreCase(userRealmResponse.federationProtocol())) { - String mexURL = userRealmResponse.getFederationMetadataUrl(); - String cloudAudienceUrn = userRealmResponse.getCloudAudienceUrn(); + String mexURL = userRealmResponse.federationMetadataUrl(); + String cloudAudienceUrn = userRealmResponse.cloudAudienceUrn(); // Discover the policy for authentication using the Metadata Exchange Url. // Get the WSTrust Token (Web Service Trust Token) diff --git a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java index 8f285506..d7df92fe 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java @@ -78,7 +78,7 @@ private AuthenticationResult acquireTokenWithDeviceCode(DeviceCode deviceCode, try { return acquireTokenByAuthorisationGrantSupplier.execute(); } catch (AuthenticationException ex) { - if (ex.getErrorCode().equals(AUTHORIZATION_PENDING)) { + if (ex.errorCode().equals(AUTHORIZATION_PENDING)) { TimeUnit.SECONDS.sleep(deviceCode.interval()); } else { throw ex; diff --git a/src/main/java/com/microsoft/aad/msal4j/AppMetadataCacheEntity.java b/src/main/java/com/microsoft/aad/msal4j/AppMetadataCacheEntity.java index fb9ef731..521f133f 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AppMetadataCacheEntity.java +++ b/src/main/java/com/microsoft/aad/msal4j/AppMetadataCacheEntity.java @@ -1,3 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package com.microsoft.aad.msal4j; import com.google.gson.annotations.SerializedName; diff --git a/src/main/java/com/microsoft/aad/msal4j/AsymmetricKeyCredential.java b/src/main/java/com/microsoft/aad/msal4j/AsymmetricKeyCredential.java index aa38923a..23952fb6 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AsymmetricKeyCredential.java +++ b/src/main/java/com/microsoft/aad/msal4j/AsymmetricKeyCredential.java @@ -40,14 +40,26 @@ import java.security.interfaces.RSAPrivateKey; import java.util.Enumeration; +import lombok.Getter; +import lombok.experimental.Accessors; import org.apache.commons.codec.binary.Base64; /** * Credential type containing X509 public certificate and RSA private key. */ public final class AsymmetricKeyCredential implements IClientCredential{ + public final static int MIN_KEY_SIZE_IN_BITS = 2048; + + /** + * Returns private key of the credential. + * + * @return private key. + */ + @Accessors(fluent = true) + @Getter private final PrivateKey key; + private final X509Certificate publicCertificate; /** @@ -113,18 +125,10 @@ public String getPublicCertificateHash() * @return base64 encoded string * @throws CertificateEncodingException if an encoding error occurs */ - public String getPublicCertificate() throws CertificateEncodingException { + public String publicCertificate() throws CertificateEncodingException { return Base64.encodeBase64String(this.publicCertificate.getEncoded()); } - /** - * Returns private key of the credential. - * - * @return private key. - */ - public PrivateKey getKey() { - return key; - } /** * Static method to create KeyCredential instance. @@ -174,5 +178,4 @@ private static byte[] getHash(final byte[] inputBytes) throws NoSuchAlgorithmExc md.update(inputBytes); return md.digest(); } - } diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java index 597c798f..d9e5c7d8 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java @@ -23,6 +23,9 @@ package com.microsoft.aad.msal4j; +import lombok.Getter; +import lombok.experimental.Accessors; + /** * MSAL generic exception class */ @@ -30,6 +33,8 @@ public class AuthenticationException extends RuntimeException { private static final long serialVersionUID = 1L; + @Accessors(fluent = true) + @Getter private AuthenticationErrorCode errorCode; /** @@ -68,8 +73,4 @@ public AuthenticationException(final String message, final Throwable t) { this.errorCode = AuthenticationErrorCode.UNKNOWN; } - - public AuthenticationErrorCode getErrorCode() { - return errorCode; - } } diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java index e09a01e2..a5136707 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java @@ -84,7 +84,7 @@ public IAuthenticationResult get() { } } catch(Exception ex) { if (ex instanceof AuthenticationException) { - apiEvent.setApiErrorCode(((AuthenticationException) ex).getErrorCode()); + apiEvent.setApiErrorCode(((AuthenticationException) ex).errorCode()); } clientApplication.log.error( LogHelper.createMessage( diff --git a/src/main/java/com/microsoft/aad/msal4j/Authority.java b/src/main/java/com/microsoft/aad/msal4j/Authority.java index 535187e7..10b84a51 100644 --- a/src/main/java/com/microsoft/aad/msal4j/Authority.java +++ b/src/main/java/com/microsoft/aad/msal4j/Authority.java @@ -1,3 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package com.microsoft.aad.msal4j; import lombok.AccessLevel; diff --git a/src/main/java/com/microsoft/aad/msal4j/B2CAuthority.java b/src/main/java/com/microsoft/aad/msal4j/B2CAuthority.java index c2c54d71..6bc304aa 100644 --- a/src/main/java/com/microsoft/aad/msal4j/B2CAuthority.java +++ b/src/main/java/com/microsoft/aad/msal4j/B2CAuthority.java @@ -1,3 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package com.microsoft.aad.msal4j; import lombok.AccessLevel; diff --git a/src/main/java/com/microsoft/aad/msal4j/ClaimsChallengeException.java b/src/main/java/com/microsoft/aad/msal4j/ClaimsChallengeException.java index 5655e484..6ee4dff7 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClaimsChallengeException.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClaimsChallengeException.java @@ -23,11 +23,21 @@ package com.microsoft.aad.msal4j; +import lombok.Getter; +import lombok.experimental.Accessors; + /** * The exception type thrown when a claims challenge error occurs during token acquisition. */ public class ClaimsChallengeException extends AuthenticationException { + /** + * claims challenge value + */ + @Accessors(fluent = true) + @Getter + private final String claims; + /** * Constructor * @@ -39,14 +49,4 @@ public ClaimsChallengeException(String message, String claims) { this.claims = claims; } - - private final String claims; - - /** - * - * @return claims challenge value - */ - public String getClaims() { - return claims; - } } diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientAssertion.java b/src/main/java/com/microsoft/aad/msal4j/ClientAssertion.java index 65c9173b..80a87fa8 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientAssertion.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientAssertion.java @@ -24,18 +24,22 @@ package com.microsoft.aad.msal4j; import com.nimbusds.oauth2.sdk.auth.JWTAuthentication; -import java.util.Objects; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.experimental.Accessors; /*** * Credential type containing an assertion of type * "urn:ietf:params:oauth:token-type:jwt". */ +@Accessors(fluent = true) +@Getter +@EqualsAndHashCode public final class ClientAssertion { + public static final String assertionType = JWTAuthentication.CLIENT_ASSERTION_TYPE; private final String assertion; - private static final String assertionType = JWTAuthentication.CLIENT_ASSERTION_TYPE; - /** * Constructor to create credential with a jwt token encoded as a base64 url * encoded string. @@ -50,37 +54,4 @@ public ClientAssertion(final String assertion) { this.assertion = assertion; } - - public String getAssertion() { - return assertion; - } - - public String getAssertionType() { - return assertionType; - } - - @Override - public int hashCode() { - int hash = 3; - hash = 97 * hash + Objects.hashCode(this.assertion); - return hash; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final ClientAssertion other = (ClientAssertion) obj; - if (!Objects.equals(this.assertion, other.assertion)) { - return false; - } - return true; - } } \ No newline at end of file diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientSecret.java b/src/main/java/com/microsoft/aad/msal4j/ClientSecret.java index 2ef1d36e..5044f5aa 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientSecret.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientSecret.java @@ -23,13 +23,23 @@ package com.microsoft.aad.msal4j; -import java.util.Objects; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.experimental.Accessors; + /** * Credential including secret. */ +@EqualsAndHashCode public final class ClientSecret implements IClientCredential { + /** + * Gets the secret of the client requesting the token. + * + */ + @Accessors(fluent = true) + @Getter private final String clientSecret; /** @@ -45,38 +55,4 @@ public ClientSecret(final String clientSecret) { this.clientSecret = clientSecret; } - - /** - * Gets the secret of the client requesting the token. - * - * @return string client secret value - */ - public String getClientSecret() { - return clientSecret; - } - - @Override - public int hashCode() { - int hash = 3; - hash = 71 * hash + Objects.hashCode(this.clientSecret); - return hash; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final ClientSecret other = (ClientSecret) obj; - if (!Objects.equals(this.clientSecret, other.clientSecret)) { - return false; - } - return true; - } } diff --git a/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java index 23877fea..ec3d62fc 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java @@ -82,7 +82,7 @@ private void initClientAuthentication(IClientCredential clientCredential) { if (clientCredential instanceof ClientSecret) { clientAuthentication = new ClientSecretPost( new ClientID(clientId()), - new Secret(((ClientSecret) clientCredential).getClientSecret())); + new Secret(((ClientSecret) clientCredential).clientSecret())); } else if (clientCredential instanceof AsymmetricKeyCredential) { ClientAssertion clientAssertion = JwtHelper.buildJwt( clientId(), @@ -99,8 +99,8 @@ private ClientAuthentication createClientAuthFromClientAssertion( final ClientAssertion clientAssertion) { try { final Map> map = new HashMap<>(); - map.put("client_assertion_type", Collections.singletonList(clientAssertion.getAssertionType())); - map.put("client_assertion", Collections.singletonList(clientAssertion.getAssertion())); + map.put("client_assertion_type", Collections.singletonList(ClientAssertion.assertionType)); + map.put("client_assertion", Collections.singletonList(clientAssertion.assertion())); return PrivateKeyJWT.parse(map); } catch (final ParseException e) { throw new AuthenticationException(e); diff --git a/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java b/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java index 2ad71575..095bcd58 100644 --- a/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java +++ b/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java @@ -76,12 +76,12 @@ static ClientAssertion buildJwt(String clientId, final AsymmetricKeyCredential c try { JWSHeader.Builder builder = new Builder(JWSAlgorithm.RS256); List certs = new ArrayList(); - certs.add(new Base64(credential.getPublicCertificate())); + certs.add(new Base64(credential.publicCertificate())); builder.x509CertChain(certs); builder.x509CertThumbprint(new Base64URL(credential .getPublicCertificateHash())); jwt = new SignedJWT(builder.build(), claimsSet); - final RSASSASigner signer = new RSASSASigner(credential.getKey()); + final RSASSASigner signer = new RSASSASigner(credential.key()); jwt.sign(signer); } diff --git a/src/main/java/com/microsoft/aad/msal4j/PublicApi.java b/src/main/java/com/microsoft/aad/msal4j/PublicApi.java index 981f7610..40608d9a 100644 --- a/src/main/java/com/microsoft/aad/msal4j/PublicApi.java +++ b/src/main/java/com/microsoft/aad/msal4j/PublicApi.java @@ -24,7 +24,7 @@ package com.microsoft.aad.msal4j; enum PublicApi { - // TODO finalize api ids + ACQUIRE_TOKEN_BY_REFRESH_TOKEN(82), ACQUIRE_TOKEN_BY_USERNAME_PASSWORD(300), ACQUIRE_TOKEN_BY_INTEGRATED_WINDOWS_AUTH(400), diff --git a/src/main/java/com/microsoft/aad/msal4j/StringHelper.java b/src/main/java/com/microsoft/aad/msal4j/StringHelper.java index 993a50ab..803ebd42 100644 --- a/src/main/java/com/microsoft/aad/msal4j/StringHelper.java +++ b/src/main/java/com/microsoft/aad/msal4j/StringHelper.java @@ -23,13 +23,9 @@ package com.microsoft.aad.msal4j; -/** - * - */ final class StringHelper { public static boolean isBlank(final String str) { return str == null || str.trim().length() == 0; } - } diff --git a/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryRequest.java b/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryRequest.java index 56688ec0..525de9c3 100644 --- a/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryRequest.java @@ -31,10 +31,10 @@ class UserDiscoveryRequest { - private final static Logger log = LoggerFactory - .getLogger(UserDiscoveryRequest.class); + private final static Logger log = LoggerFactory.getLogger(UserDiscoveryRequest.class); private final static Map HEADERS; + static { HEADERS = new HashMap<>(); HEADERS.put("Accept", "application/json, text/javascript, */*"); diff --git a/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryResponse.java b/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryResponse.java index 2fcad4f1..c8d9f445 100644 --- a/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryResponse.java +++ b/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryResponse.java @@ -24,7 +24,12 @@ package com.microsoft.aad.msal4j; import com.google.gson.annotations.SerializedName; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.experimental.Accessors; +@Accessors(fluent = true) +@Getter(AccessLevel.PACKAGE) class UserDiscoveryResponse { @SerializedName("ver") @@ -45,10 +50,6 @@ class UserDiscoveryResponse { @SerializedName("cloud_audience_urn") private String cloudAudienceUrn; - float getVersion() { - return version; - } - boolean isAccountFederated() { return !StringHelper.isBlank(this.accountType) && this.accountType.equalsIgnoreCase("Federated"); @@ -58,20 +59,4 @@ boolean isAccountManaged() { return !StringHelper.isBlank(this.accountType) && this.accountType.equalsIgnoreCase("Managed"); } - - String getFederationProtocol() { - return federationProtocol; - } - - String getFederationMetadataUrl() { - return federationMetadataUrl; - } - - String getFederationActiveAuthUrl() { - return federationActiveAuthUrl; - } - - String getCloudAudienceUrn() { - return cloudAudienceUrn; - } } diff --git a/src/main/java/com/microsoft/aad/msal4j/WSTrustResponse.java b/src/main/java/com/microsoft/aad/msal4j/WSTrustResponse.java index 649b9675..2d4cbed0 100644 --- a/src/main/java/com/microsoft/aad/msal4j/WSTrustResponse.java +++ b/src/main/java/com/microsoft/aad/msal4j/WSTrustResponse.java @@ -119,7 +119,7 @@ private static void parseToken(WSTrustResponse responseValue, throws Exception { NodeList tokenTypeNodes = (NodeList) xPath.compile( - version.getResponseTokenTypePath()).evaluate(xmlDocument, + version.responseTokenTypePath()).evaluate(xmlDocument, XPathConstants.NODESET); if (tokenTypeNodes.getLength() == 0) { String msg = "No TokenType elements found in RSTR"; @@ -142,7 +142,7 @@ private static void parseToken(WSTrustResponse responseValue, } NodeList requestedTokenNodes = (NodeList) xPath.compile( - version.getResponseSecurityTokenPath()).evaluate( + version.responseSecurityTokenPath()).evaluate( tokenTypeNode.getParentNode(), XPathConstants.NODESET); if (requestedTokenNodes.getLength() > 1) { throw new Exception( diff --git a/src/main/java/com/microsoft/aad/msal4j/WSTrustVersion.java b/src/main/java/com/microsoft/aad/msal4j/WSTrustVersion.java index 736562b5..1170941e 100644 --- a/src/main/java/com/microsoft/aad/msal4j/WSTrustVersion.java +++ b/src/main/java/com/microsoft/aad/msal4j/WSTrustVersion.java @@ -23,6 +23,12 @@ package com.microsoft.aad.msal4j; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.experimental.Accessors; + +@Accessors(fluent = true) +@Getter(AccessLevel.PACKAGE) enum WSTrustVersion { WSTRUST13( @@ -37,12 +43,4 @@ enum WSTrustVersion { this.responseTokenTypePath = tokenType; this.responseSecurityTokenPath = responseSecurityToken; } - - public String getResponseTokenTypePath() { - return this.responseTokenTypePath; - } - - public String getResponseSecurityTokenPath() { - return this.responseSecurityTokenPath; - } } diff --git a/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java b/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java index d72a6d8f..ee738ea7 100644 --- a/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java @@ -263,7 +263,7 @@ public void executeAcquireDeviceCode_AuthenticaionPendingErrorReturned_Authentic request.executeOauthRequestAndProcessResponse(); Assert.fail("Expected AuthenticationException was not thrown"); } catch (AuthenticationException ex) { - Assert.assertEquals(ex.getErrorCode(), AuthenticationErrorCode.AUTHORIZATION_PENDING); + Assert.assertEquals(ex.errorCode(), AuthenticationErrorCode.AUTHORIZATION_PENDING); } PowerMock.verifyAll(); } diff --git a/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java b/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java index 03a84181..a6570e7b 100644 --- a/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java @@ -103,7 +103,7 @@ public void executeOAuthRequest_SCBadRequestErrorInteractionRequired_ClaimsChall request.executeOauthRequestAndProcessResponse(); Assert.fail("Expected ClaimsChallengeException was not thrown"); } catch (ClaimsChallengeException ex) { - Assert.assertEquals(claims.replace("\\", ""), ex.getClaims()); + Assert.assertEquals(claims.replace("\\", ""), ex.claims()); } PowerMock.verifyAll(); } From 8d8c09423422af065f2997e751a7431b1d5efd77 Mon Sep 17 00:00:00 2001 From: sgonzalezMSFT Date: Tue, 25 Jun 2019 12:37:43 -0700 Subject: [PATCH 06/16] Expose headers and subErrors in exceptions --- .../aad/msal4j/AadInstanceDiscovery.java | 8 +- .../AcquireTokenByDeviceCodeFlowSupplier.java | 6 +- .../com/microsoft/aad/msal4j/ApiEvent.java | 4 +- .../msal4j/AuthenticationClientException.java | 23 +++ .../aad/msal4j/AuthenticationErrorCode.java | 20 +-- .../msal4j/AuthenticationErrorMessage.java | 70 --------- .../aad/msal4j/AuthenticationException.java | 45 +++--- .../msal4j/AuthenticationResultSupplier.java | 4 +- .../AuthenticationServiceException.java | 92 ++++++++++++ .../com/microsoft/aad/msal4j/Authority.java | 4 +- .../aad/msal4j/ClientApplicationBase.java | 2 +- .../msal4j/ConfidentialClientApplication.java | 2 +- ...lengeException.java => ErrorResponse.java} | 65 +++++---- .../com/microsoft/aad/msal4j/HttpHelper.java | 4 +- .../aad/msal4j/InstanceDiscoveryResponse.java | 2 + .../com/microsoft/aad/msal4j/JwtHelper.java | 2 +- .../aad/msal4j/OAuthHttpRequest.java | 28 ++-- .../aad/msal4j/OnBehalfOfRequest.java | 2 +- .../microsoft/aad/msal4j/TokenRequest.java | 82 +++++------ .../microsoft/aad/msal4j/WSTrustRequest.java | 4 +- .../microsoft/aad/msal4j/AuthorityTest.java | 5 +- .../aad/msal4j/DeviceCodeFlowTest.java | 4 +- .../aad/msal4j/OauthHttpRequestTest.java | 21 +-- .../aad/msal4j/TokenRequestTest.java | 133 +++++++++++------- 24 files changed, 342 insertions(+), 290 deletions(-) create mode 100644 src/main/java/com/microsoft/aad/msal4j/AuthenticationClientException.java delete mode 100644 src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorMessage.java create mode 100644 src/main/java/com/microsoft/aad/msal4j/AuthenticationServiceException.java rename src/main/java/com/microsoft/aad/msal4j/{ClaimsChallengeException.java => ErrorResponse.java} (60%) diff --git a/src/main/java/com/microsoft/aad/msal4j/AadInstanceDiscovery.java b/src/main/java/com/microsoft/aad/msal4j/AadInstanceDiscovery.java index 8313e747..5704481d 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AadInstanceDiscovery.java +++ b/src/main/java/com/microsoft/aad/msal4j/AadInstanceDiscovery.java @@ -86,8 +86,8 @@ private static String getInstanceDiscoveryEndpoint(String host) { } private static void validate(InstanceDiscoveryResponse instanceDiscoveryResponse) { - if (StringHelper.isBlank(instanceDiscoveryResponse.getTenantDiscoveryEndpoint())) { - throw new AuthenticationException(instanceDiscoveryResponse.getErrorDescription()); + if (StringHelper.isBlank(instanceDiscoveryResponse.tenantDiscoveryEndpoint())) { + throw new AuthenticationServiceException(instanceDiscoveryResponse); } } @@ -117,8 +117,8 @@ private static void validate(InstanceDiscoveryResponse instanceDiscoveryResponse } private static void cacheInstanceDiscoveryMetadata(String host, InstanceDiscoveryResponse instanceDiscoveryResponse) { - if (instanceDiscoveryResponse.getMetadata() != null) { - for (InstanceDiscoveryMetadataEntry entry : instanceDiscoveryResponse.getMetadata()) { + if (instanceDiscoveryResponse.metadata() != null) { + for (InstanceDiscoveryMetadataEntry entry : instanceDiscoveryResponse.metadata()) { for (String alias : entry.aliases) { cache.put(alias, entry); } diff --git a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java index 8f285506..42151c12 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java @@ -77,15 +77,15 @@ private AuthenticationResult acquireTokenWithDeviceCode(DeviceCode deviceCode, } try { return acquireTokenByAuthorisationGrantSupplier.execute(); - } catch (AuthenticationException ex) { - if (ex.getErrorCode().equals(AUTHORIZATION_PENDING)) { + } catch (AuthenticationServiceException ex) { + if (ex.errorCode().equals(AUTHORIZATION_PENDING)) { TimeUnit.SECONDS.sleep(deviceCode.interval()); } else { throw ex; } } } - throw new AuthenticationException("Expired Device code"); + throw new AuthenticationClientException("Expired Device code"); } private Long getCurrentSystemTimeInSeconds(){ diff --git a/src/main/java/com/microsoft/aad/msal4j/ApiEvent.java b/src/main/java/com/microsoft/aad/msal4j/ApiEvent.java index c193875e..47b07407 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ApiEvent.java +++ b/src/main/java/com/microsoft/aad/msal4j/ApiEvent.java @@ -95,7 +95,7 @@ public void setIsConfidentialClient(boolean isConfidentialClient){ this.put(IS_CONFIDENTIAL_CLIENT_KEY, String.valueOf(isConfidentialClient).toLowerCase(Locale.ROOT)); } - public void setApiErrorCode(AuthenticationErrorCode apiErrorCode){ - this.put(API_ERROR_CODE_KEY, apiErrorCode.toString()); + public void setApiErrorCode(String apiErrorCode){ + this.put(API_ERROR_CODE_KEY, apiErrorCode); } } diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationClientException.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationClientException.java new file mode 100644 index 00000000..d727d4c9 --- /dev/null +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationClientException.java @@ -0,0 +1,23 @@ +package com.microsoft.aad.msal4j; + +/** + * Exception type thrown when and error occurs that is local to the library or the device. + */ +public class AuthenticationClientException extends AuthenticationException{ + + /** + * Initializes a new instance of the exception class with a specified error message + * @param throwable the inner exception that is the cause of the current exception + */ + public AuthenticationClientException(final Throwable throwable){ + super(throwable); + } + + /** + * Initializes a new instance of the exception class with a specified error message + * @param message the error message that explains the reason for the exception + */ + public AuthenticationClientException(final String message){ + super(message); + } +} diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java index aadd100f..dd7050ab 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java @@ -23,20 +23,10 @@ package com.microsoft.aad.msal4j; -public enum AuthenticationErrorCode { +public class AuthenticationErrorCode { - UNKNOWN ("unknown"), - AUTHORIZATION_PENDING ("authorization_pending"), - INTERACTION_REQUIRED ("interaction_required"); - - private String errorCode; - - AuthenticationErrorCode(String errorCode){ - this.errorCode = errorCode; - } - - @Override - public String toString(){ - return errorCode; - } + public final static String AUTHORIZATION_PENDING = "authorization_pending"; + public final static String INTERACTION_REQUIRED = "interaction_required"; + public final static String INVALID_GRANT = "invalid_grant"; + public final static String UNKNOWN = "unknown"; } diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorMessage.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorMessage.java deleted file mode 100644 index a47aa657..00000000 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorMessage.java +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - -package com.microsoft.aad.msal4j; - -class AuthenticationErrorMessage { - - final static String ACCESSING_METADATA_DOCUMENT_FAILED = "Accessing WS metadata exchange failed"; - final static String AUTHORITY_INVALID_URI_FORMAT = "'authority' should be in Uri format"; - final static String AUTHORITY_NOT_IN_VALID_LIST = "'authority' is not in the list of valid addresses"; - final static String AUTHORITY_URI_INSECURE = "'authority' should use the 'https' scheme"; - final static String AUTHORITY_URI_INVALID_PATH = "'authority' Uri should have at least one segment in the path (i.e. https:////...)"; - final static String AUTHORIZATION_SERVER_INVALID_RESPONSE = "The authorization server returned an invalid response"; - final static String CERTIFICATE_KEY_SIZE_TOO_SMALL_TEMPLATE = "The certificate used must have a key size of at least %s bits"; - final static String EMAIL_ADDRESS_SUFFIX_MISMATCH = "No identity provider email address suffix matches the provided address"; - final static String ENCODED_TOKEN_TOO_LONG = "Encoded token size is beyond the upper limit"; - final static String FEDERATED_SERVICE_RETURNED_ERROR_TEMPLATE = "Federated service at %s returned error: %s"; - final static String IDENTITY_PROTOCOL_LOGIN_URL_NULL = "The LoginUrl property in identityProvider cannot be null"; - final static String IDENTITY_PROTOCOL_MISMATCH = "No identity provider matches the requested protocol"; - final static String IDENTITY_PROVIDER_REQUEST_FAILED = "Token request to identity provider failed. Check InnerException for more details"; - final static String INVALID_ARGUMENT_LENGTH = "Parameter has invalid length"; - final static String INVALID_AUTHENTICATE_HEADER_FORMAT = "Invalid authenticate header format"; - final static String INVALID_AUTHORITY_TYPE_TEMPLATE = "This method overload is not supported by '%s'"; - final static String INVALID_CREDENTIAL_TYPE = "Invalid credential type"; - final static String INVALID_FORMAT_PARAMETER_TEMPLATE = "Parameter '%s' has invalid format"; - final static String INVALID_TOKEN_CACHE_KEY_FORMAT = "Invalid token cache key format"; - final static String MISSING_AUTHENTICATE_HEADER = "WWW-Authenticate header was expected in the response"; - final static String MULTIPLE_TOKENS_MATCHED = "The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements (e.g. UserId)"; - final static String NO_DATA_FROM_STS = "No data received from security token service"; - final static String NULL_PARAMETER_TEMPLATE = "Parameter '%s' cannot be null"; - final static String PARSING_METADATA_DOCUMENT_FAILED = "Parsing WS metadata exchange failed"; - final static String PARSING_WS_TRUST_RESPONSE_FAILED = "Parsing WS-Trust response failed"; - final static String REDIRECT_URI_CONTAINS_FRAGMENT = "'redirectUri' must NOT include a fragment component"; - final static String SERVICE_RETURNED_ERROR = "Service returned error. Check InnerException for more details"; - final static String STS_METADATA_REQUEST_FAILED = "Metadata request to Access Control service failed. Check InnerException for more details"; - final static String STS_TOKEN_REQUEST_FAILED = "Token request to security token service failed. Check InnerException for more details"; - final static String UNAUTHORIZED_HTTP_STATUS_CODE_EXPECTED = "Unauthorized Http Status Code (401) was expected in the response"; - final static String UNAUTHORIZED_RESPONSE_EXPECTED = "Unauthorized http response (status code 401) was expected"; - final static String UNEXPECTED_AUTHORITY_VALID_LIST = "Unexpected list of valid addresses"; - final static String UNKNOWN = "Unknown error"; - final static String UNKNOWN_USER = "Could not identify logged in user"; - final static String UNKNOWN_USER_TYPE = "Unknown User Type"; - final static String UNSUPPORTED_AUTHORITY_VALIDATION = "Authority validation is not supported for this type of authority"; - final static String UNSUPPORTED_MULTI_REFRESH_TOKEN = "This authority does not support refresh token for multiple resources. Pass null as a resource"; - final static String AUTHENTICATION_CANCELED = "User canceled authentication"; - final static String USER_MISMATCH = "User returned by service does not match the one in the request"; - final static String USER_CREDENTIAL_FOR_MANAGED_USERS_UNSUPPORTED = "UserCredential for Managed Users Unsupported"; - final static String USER_REALM_DISCOVERY_FAILED = "User realm discovery failed"; - final static String WS_TRUST_ENDPOINT_NOT_FOUND_IN_METADATA_DOCUMENT = "WS-Trust endpoint not found in metadata document"; -} diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java index 597c798f..4a076f30 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java @@ -23,53 +23,42 @@ package com.microsoft.aad.msal4j; +import lombok.AccessLevel; +import lombok.Getter; +import lombok.experimental.Accessors; + /** - * MSAL generic exception class + * Base exception type thrown when an error occurs during token acquisition. */ +@Accessors(fluent = true) +@Getter public class AuthenticationException extends RuntimeException { + @Getter(value = AccessLevel.PRIVATE) private static final long serialVersionUID = 1L; - private AuthenticationErrorCode errorCode; - /** - * Constructor - * - * @param t Throwable object + * Initializes a new instance of the exception class + * @param throwable the inner exception that is the cause of the current exception */ - public AuthenticationException(final Throwable t) { - super(t); - - this.errorCode = AuthenticationErrorCode.UNKNOWN; + public AuthenticationException(final Throwable throwable) { + super(throwable); } /** - * Constructor - * - * @param message string error message + * Initializes a new instance of the exception class + * @param message the error message that explains the reason for the exception */ public AuthenticationException(final String message) { - this(AuthenticationErrorCode.UNKNOWN, message); - } - - public AuthenticationException(AuthenticationErrorCode errorCode, final String message) { super(message); - this.errorCode = errorCode; } /** - * Constructor - * - * @param message string error message - * @param t Throwable object + * Initializes a new instance of the exception class + * @param message the error message that explains the reason for the exception + * @param t the inner exception that is the cause of the current exception */ public AuthenticationException(final String message, final Throwable t) { super(message, t); - - this.errorCode = AuthenticationErrorCode.UNKNOWN; - } - - public AuthenticationErrorCode getErrorCode() { - return errorCode; } } diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java index e09a01e2..e9170326 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java @@ -83,8 +83,8 @@ public IAuthenticationResult get() { apiEvent.setTenantId(result.accountCacheEntity().realm()); } } catch(Exception ex) { - if (ex instanceof AuthenticationException) { - apiEvent.setApiErrorCode(((AuthenticationException) ex).getErrorCode()); + if (ex instanceof AuthenticationServiceException) { + apiEvent.setApiErrorCode(((AuthenticationServiceException) ex).errorCode()); } clientApplication.log.error( LogHelper.createMessage( diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationServiceException.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationServiceException.java new file mode 100644 index 00000000..2b8ff17a --- /dev/null +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationServiceException.java @@ -0,0 +1,92 @@ +package com.microsoft.aad.msal4j; + +import lombok.Getter; +import lombok.experimental.Accessors; + +import java.util.List; +import java.util.Map; + +/** + * Exception type thrown when service returns an error response or other networking errors occur. + */ +@Accessors(fluent = true) +@Getter +public class AuthenticationServiceException extends AuthenticationException{ + + /** + * The protocol error code returned by the service + */ + private String errorCode; + + /** + * More specific error + */ + private String subError; + + /** + * Status code returned from http layer + */ + private Integer statusCode; + + /** + * Status message returned from the http layer + */ + private String statusMessage; + + /** + * An ID that can used to piece up a single authentication flow. + */ + private String correlationId; + + /** + * Claims included in the claims challenge + */ + private String claims; + + /** + * Contains the http headers from the server response that indicated an error. + * When the server returns a 429 Too Many Requests error, a Retry-After should be set. + * It is important to read and respect the time specified in the Retry-After header + */ + private Map> headers; + + /** + * Initializes a new instance of the exception class with a specified error message + * @param message the error message that explains the reason for the exception + */ + public AuthenticationServiceException(final String message){ + super(message); + } + + /** + * Initializes a new instance of the exception class + * @param errorResponse response object contain information about error returned by server + * @param httpHeaders http headers from the server response + */ + public AuthenticationServiceException( + final ErrorResponse errorResponse, + final Map> httpHeaders) { + + super(errorResponse.errorDescription); + + this.errorCode = errorResponse.error(); + this.statusCode = errorResponse.statusCode(); + this.statusMessage = errorResponse.statusMessage(); + this.subError = errorResponse.subError(); + this.correlationId = errorResponse.correlation_id(); + this.claims = errorResponse.claims(); + this.headers = httpHeaders; + } + + /** + * Initializes a new instance of the exception class + * @param discoveryResponse response object from instance discovery network call + */ + public AuthenticationServiceException(InstanceDiscoveryResponse discoveryResponse){ + + super(discoveryResponse.errorDescription()); + + this.errorCode = discoveryResponse.error(); + this.correlationId = discoveryResponse.correlationId(); + } +} diff --git a/src/main/java/com/microsoft/aad/msal4j/Authority.java b/src/main/java/com/microsoft/aad/msal4j/Authority.java index 535187e7..c08a8604 100644 --- a/src/main/java/com/microsoft/aad/msal4j/Authority.java +++ b/src/main/java/com/microsoft/aad/msal4j/Authority.java @@ -61,7 +61,7 @@ static AuthorityType detectAuthorityType(URL authorityUrl) { final String path = authorityUrl.getPath().substring(1); if (StringHelper.isBlank(path)) { throw new IllegalArgumentException( - AuthenticationErrorMessage.AUTHORITY_URI_INVALID_PATH); + "authority Uri should have at least one segment in the path (i.e. https:////...)"); } final String firstPath = path.substring(0, path.indexOf("/")); @@ -79,7 +79,7 @@ static AuthorityType detectAuthorityType(URL authorityUrl) { void validateAuthorityUrl() { if (!this.canonicalAuthorityUrl.getProtocol().equalsIgnoreCase("https")) { throw new IllegalArgumentException( - AuthenticationErrorMessage.AUTHORITY_URI_INSECURE); + "authority should use the 'https' scheme"); } if (this.canonicalAuthorityUrl.toString().contains("#")) { diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java b/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java index d13f5707..cf053487 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java @@ -409,7 +409,7 @@ private static Authority createDefaultAADAuthority() { try { authority = new AADAuthority(new URL(DEFAULT_AUTHORITY)); } catch(Exception e){ - throw new AuthenticationException(e); + throw new AuthenticationClientException(e); } return authority; } diff --git a/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java index 23877fea..cc64f101 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java @@ -103,7 +103,7 @@ private ClientAuthentication createClientAuthFromClientAssertion( map.put("client_assertion", Collections.singletonList(clientAssertion.getAssertion())); return PrivateKeyJWT.parse(map); } catch (final ParseException e) { - throw new AuthenticationException(e); + throw new AuthenticationClientException(e); } } diff --git a/src/main/java/com/microsoft/aad/msal4j/ClaimsChallengeException.java b/src/main/java/com/microsoft/aad/msal4j/ErrorResponse.java similarity index 60% rename from src/main/java/com/microsoft/aad/msal4j/ClaimsChallengeException.java rename to src/main/java/com/microsoft/aad/msal4j/ErrorResponse.java index 5655e484..488d0eb3 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClaimsChallengeException.java +++ b/src/main/java/com/microsoft/aad/msal4j/ErrorResponse.java @@ -23,30 +23,43 @@ package com.microsoft.aad.msal4j; -/** - * The exception type thrown when a claims challenge error occurs during token acquisition. - */ -public class ClaimsChallengeException extends AuthenticationException { - - /** - * Constructor - * - * @param message string error message - * @param claims claims challenge returned from the STS - */ - public ClaimsChallengeException(String message, String claims) { - super(message); - - this.claims = claims; - } - - private final String claims; - - /** - * - * @return claims challenge value - */ - public String getClaims() { - return claims; - } +import com.google.gson.annotations.SerializedName; +import lombok.Getter; +import lombok.Setter; +import lombok.experimental.Accessors; + +@Accessors(fluent = true) +@Getter +@Setter +class ErrorResponse { + + private Integer statusCode; + private String statusMessage; + + @SerializedName("error") + protected String error; + + @SerializedName("error_description") + protected String errorDescription; + + @SerializedName("error_codes") + protected long[] errorCodes; + + @SerializedName("suberror") + protected String subError; + + @SerializedName("trace_id") + protected String traceId; + + @SerializedName("timestamp") + protected String timestamp; + + @SerializedName("correlation_id") + protected String correlation_id; + + @SerializedName("claims") + private String claims; } + + + diff --git a/src/main/java/com/microsoft/aad/msal4j/HttpHelper.java b/src/main/java/com/microsoft/aad/msal4j/HttpHelper.java index 5181cc21..44786250 100644 --- a/src/main/java/com/microsoft/aad/msal4j/HttpHelper.java +++ b/src/main/java/com/microsoft/aad/msal4j/HttpHelper.java @@ -180,8 +180,8 @@ static String readResponseFromConnection(final HttpsURLConnection conn, HttpEven if (is != null) { msg = msg + ", Error details : " + inputStreamToString(is); } - httpEvent.setOauthErrorCode(AuthenticationErrorCode.UNKNOWN.toString()); - throw new AuthenticationException(msg); + httpEvent.setOauthErrorCode(AuthenticationErrorCode.UNKNOWN); + throw new AuthenticationServiceException(msg); } is = conn.getInputStream(); diff --git a/src/main/java/com/microsoft/aad/msal4j/InstanceDiscoveryResponse.java b/src/main/java/com/microsoft/aad/msal4j/InstanceDiscoveryResponse.java index 33ca670a..3d37b30e 100644 --- a/src/main/java/com/microsoft/aad/msal4j/InstanceDiscoveryResponse.java +++ b/src/main/java/com/microsoft/aad/msal4j/InstanceDiscoveryResponse.java @@ -26,7 +26,9 @@ import com.google.gson.annotations.SerializedName; import lombok.AccessLevel; import lombok.Getter; +import lombok.experimental.Accessors; +@Accessors(fluent = true) @Getter(AccessLevel.PACKAGE) class InstanceDiscoveryResponse { diff --git a/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java b/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java index 2ad71575..93bf18a7 100644 --- a/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java +++ b/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java @@ -86,7 +86,7 @@ static ClientAssertion buildJwt(String clientId, final AsymmetricKeyCredential c jwt.sign(signer); } catch (final Exception e) { - throw new AuthenticationException(e); + throw new AuthenticationClientException(e); } return new ClientAssertion(jwt.serialize()); diff --git a/src/main/java/com/microsoft/aad/msal4j/OAuthHttpRequest.java b/src/main/java/com/microsoft/aad/msal4j/OAuthHttpRequest.java index f4e87a57..9abf2952 100644 --- a/src/main/java/com/microsoft/aad/msal4j/OAuthHttpRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/OAuthHttpRequest.java @@ -43,6 +43,7 @@ import java.net.URL; import java.nio.charset.StandardCharsets; import java.util.Collections; +import java.util.List; import java.util.Map; class OAuthHttpRequest extends HTTPRequest { @@ -74,9 +75,11 @@ public HTTPResponse send() throws IOException { return createResponse(conn, out); } - HTTPResponse createResponse(final HttpURLConnection conn, final String out) + private HTTPResponse createResponse(final HttpURLConnection conn, final String out) throws IOException { + final HTTPResponse response = new HTTPResponse(conn.getResponseCode()); + final String location = conn.getHeaderField("Location"); if (!StringHelper.isBlank(location)) { try { @@ -94,16 +97,26 @@ HTTPResponse createResponse(final HttpURLConnection conn, final String out) + e.getMessage(), e); } - response.setCacheControl(conn.getHeaderField("Cache-Control")); - response.setPragma(conn.getHeaderField("Pragma")); - response.setWWWAuthenticate(conn.getHeaderField("WWW-Authenticate")); + Map> headers = conn.getHeaderFields(); + for(Map.Entry> header: headers.entrySet()){ + + if(header.getKey() == null || StringHelper.isBlank(header.getKey())){ + continue; + } + + String headerValue = response.getHeaderValue(header.getKey()); + if(headerValue == null || StringHelper.isBlank(headerValue)){ + response.setHeader(header.getKey(), header.getValue().toArray(new String[0])); + } + } + if (!StringHelper.isBlank(out)) { response.setContent(out); } return response; } - void configureHeaderAndExecuteOAuthCall(final HttpsURLConnection conn) + private void configureHeaderAndExecuteOAuthCall(final HttpsURLConnection conn) throws IOException { if (this.getAuthorization() != null) { @@ -123,8 +136,7 @@ void configureHeaderAndExecuteOAuthCall(final HttpsURLConnection conn) HttpHelper.configureAdditionalHeaders(conn, params); conn.setDoOutput(true); - conn.setRequestProperty("Content-Type", - CommonContentTypes.APPLICATION_URLENCODED.toString()); + conn.setRequestProperty("Content-Type", CommonContentTypes.APPLICATION_URLENCODED.toString()); if (this.getQuery() != null) { try(final OutputStreamWriter writer = new OutputStreamWriter( @@ -135,7 +147,7 @@ void configureHeaderAndExecuteOAuthCall(final HttpsURLConnection conn) } } - String processAndReadResponse(final HttpURLConnection conn) + private String processAndReadResponse(final HttpURLConnection conn) throws IOException { Reader inReader; final int responseCode = conn.getResponseCode(); diff --git a/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfRequest.java b/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfRequest.java index a50f0dc1..7b36d190 100644 --- a/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfRequest.java @@ -50,7 +50,7 @@ private static OAuthAuthorizationGrant createAuthenticationGrant(OnBehalfOfParam try { jWTBearerGrant = new JWTBearerGrant(SignedJWT.parse(parameters.userAssertion().getAssertion())); } catch (Exception e) { - throw new AuthenticationException(e); + throw new AuthenticationClientException(e); } Map> params = new HashMap<>(); diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java b/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java index b1e95de8..3dfeb7cd 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java @@ -26,16 +26,15 @@ import java.io.IOException; import java.net.URISyntaxException; import java.net.URL; +import java.util.Arrays; import java.util.Date; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; -import com.nimbusds.oauth2.sdk.ErrorObject; -import com.google.gson.JsonElement; -import com.google.gson.JsonParser; import com.nimbusds.oauth2.sdk.ParseException; import com.nimbusds.oauth2.sdk.SerializeException; -import com.nimbusds.oauth2.sdk.TokenErrorResponse; import com.nimbusds.oauth2.sdk.http.CommonContentTypes; import com.nimbusds.oauth2.sdk.http.HTTPRequest; import com.nimbusds.oauth2.sdk.http.HTTPResponse; @@ -61,14 +60,6 @@ class TokenRequest { this.msalRequest = msalRequest; } - /** - * - * @return - * @throws ParseException - * @throws AuthenticationException - * @throws SerializeException - * @throws IOException - */ AuthenticationResult executeOauthRequestAndProcessResponse() throws ParseException, AuthenticationException, SerializeException, IOException { @@ -139,40 +130,50 @@ AuthenticationResult executeOauthRequestAndProcessResponse() build(); } else { - final TokenErrorResponse errorResponse = TokenErrorResponse.parse(httpResponse); - ErrorObject errorObject = errorResponse.getErrorObject(); - if (AuthenticationErrorCode.AUTHORIZATION_PENDING.toString() - .equals(errorObject.getCode())) { - - httpEvent.setOauthErrorCode(AuthenticationErrorCode.AUTHORIZATION_PENDING.toString()); - - throw new AuthenticationException(AuthenticationErrorCode.AUTHORIZATION_PENDING, - errorObject.getDescription()); + String responseContent = httpResponse.getContent(); + if(responseContent == null || StringHelper.isBlank(responseContent)){ + throw new AuthenticationServiceException("Unknown Service Exception"); } - if (HTTPResponse.SC_BAD_REQUEST == errorObject.getHTTPStatusCode() && - AuthenticationErrorCode.INTERACTION_REQUIRED.toString().equals(errorObject.getCode())) { + ErrorResponse errorResponse = JsonHelper.convertJsonToObject( + responseContent, + ErrorResponse.class); - httpEvent.setOauthErrorCode(AuthenticationErrorCode.INTERACTION_REQUIRED.toString()); + errorResponse.statusCode(httpResponse.getStatusCode()); + errorResponse.statusMessage(httpResponse.getStatusMessage()); - throw new ClaimsChallengeException( - errorResponse.toJSONObject().toJSONString(), - getClaims(httpResponse.getContent())); - } else { - String telemetryErrorCode = StringHelper.isBlank(errorObject.getCode()) ? - AuthenticationErrorCode.UNKNOWN.toString() : - errorObject.getCode(); + // Some invalid_grant or interaction_required subError codes returned by + // the service are not supposed to be exposed to customers + if(errorResponse.error() != null && + errorResponse.error().equalsIgnoreCase(AuthenticationErrorCode.INVALID_GRANT) || + errorResponse.error().equalsIgnoreCase(AuthenticationErrorCode.INTERACTION_REQUIRED)){ + errorResponse = filterSubErrorCode(errorResponse); + } - httpEvent.setOauthErrorCode(telemetryErrorCode); + httpEvent.setOauthErrorCode(errorResponse.error()); - throw new AuthenticationException(errorResponse.toJSONObject().toJSONString()); - } + throw new AuthenticationServiceException( + errorResponse, + httpResponse.getHeaderMap()); } return result; } } + private ErrorResponse filterSubErrorCode(ErrorResponse errorResponse){ + String[] errorsThatShouldNotBeExposed = {"bad_token", "token_expired", + "protection_policy_required", "client_mismatch", "device_authentication_failed"}; + + Set set = new HashSet<>(Arrays.asList(errorsThatShouldNotBeExposed)); + + if(set.contains(errorResponse.subError)){ + errorResponse.subError(""); + } + + return errorResponse; + } + private void addResponseHeadersToHttpEvent(HttpEvent httpEvent, HTTPResponse httpResponse) { httpEvent.setHttpResponseStatus(httpResponse.getStatusCode()); @@ -209,19 +210,6 @@ private HttpEvent createHttpEvent() { return httpEvent; } - private String getClaims(String httpResponseContentStr) { - JsonElement root = new JsonParser().parse(httpResponseContentStr); - - JsonElement claims = root.getAsJsonObject().get("claims"); - - return claims != null ? claims.getAsString() : null; - } - - /** - * - * @return - * @throws SerializeException - */ OAuthHttpRequest toOauthHttpRequest() throws SerializeException { if (this.url == null) { diff --git a/src/main/java/com/microsoft/aad/msal4j/WSTrustRequest.java b/src/main/java/com/microsoft/aad/msal4j/WSTrustRequest.java index f32af122..5497daae 100644 --- a/src/main/java/com/microsoft/aad/msal4j/WSTrustRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/WSTrustRequest.java @@ -88,7 +88,7 @@ static WSTrustResponse execute(String url, BindingPolicy policy = MexParser.getWsTrustEndpointFromMexResponse(mexResponse, logPii); if(policy == null){ - throw new AuthenticationException("WsTrust endpoint not found in metadata document"); + throw new AuthenticationServiceException("WsTrust endpoint not found in metadata document"); } return execute(username, password, cloudAudienceUrn, policy, requestContext, serviceBundle); @@ -112,7 +112,7 @@ static WSTrustResponse execute(String mexURL, BindingPolicy policy = MexParser.getPolicyFromMexResponseForIntegrated(mexResponse, logPii); if(policy == null){ - throw new AuthenticationException("WsTrust endpoint not found in metadata document"); + throw new AuthenticationServiceException("WsTrust endpoint not found in metadata document"); } return execute(null, null, cloudAudienceUrn, policy, requestContext, serviceBundle); diff --git a/src/test/java/com/microsoft/aad/msal4j/AuthorityTest.java b/src/test/java/com/microsoft/aad/msal4j/AuthorityTest.java index efd9de18..9f67ba93 100644 --- a/src/test/java/com/microsoft/aad/msal4j/AuthorityTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/AuthorityTest.java @@ -56,10 +56,9 @@ public void testDetectAuthorityType_B2C() throws Exception { @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = - "'authority' Uri should have at least one segment in the path \\(i.e. https:////...\\)") + "authority Uri should have at least one segment in the path \\(i.e. https:////...\\)") public void testAADAuthorityConstructor_NoPathAuthority() throws MalformedURLException { new AADAuthority(new URL("https://something.com/")); - } @Test(expectedExceptions = IllegalArgumentException.class, @@ -79,7 +78,7 @@ public void testB2CAuthorityConstructor_NullAuthority() { new B2CAuthority(null); } - @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = AuthenticationErrorMessage.AUTHORITY_URI_INSECURE) + @Test(expectedExceptions = IllegalArgumentException.class, expectedExceptionsMessageRegExp = "authority should use the 'https' scheme") public void testAADAuthorityConstructor_HttpAuthority() throws MalformedURLException { new AADAuthority(new URL("http://I.com/not/h/t/t/p/s/")); } diff --git a/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java b/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java index d72a6d8f..86fbc126 100644 --- a/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java @@ -262,8 +262,8 @@ public void executeAcquireDeviceCode_AuthenticaionPendingErrorReturned_Authentic try { request.executeOauthRequestAndProcessResponse(); Assert.fail("Expected AuthenticationException was not thrown"); - } catch (AuthenticationException ex) { - Assert.assertEquals(ex.getErrorCode(), AuthenticationErrorCode.AUTHORIZATION_PENDING); + } catch (AuthenticationServiceException ex) { + Assert.assertEquals(ex.errorCode(), AuthenticationErrorCode.AUTHORIZATION_PENDING); } PowerMock.verifyAll(); } diff --git a/src/test/java/com/microsoft/aad/msal4j/OauthHttpRequestTest.java b/src/test/java/com/microsoft/aad/msal4j/OauthHttpRequestTest.java index 4b7a55f6..a74eae00 100644 --- a/src/test/java/com/microsoft/aad/msal4j/OauthHttpRequestTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/OauthHttpRequestTest.java @@ -38,6 +38,7 @@ import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; +import java.util.HashMap; import static org.testng.Assert.assertNotNull; @@ -82,20 +83,12 @@ public void testCreateResponseLocationNull() .times(1); EasyMock.expect(conn.getContentType()) .andReturn("application/x-www-form-urlencoded").times(1); - EasyMock.expect(conn.getHeaderField("Cache-Control")).andReturn("cc") - .times(1); - EasyMock.expect(conn.getHeaderField("Pragma")).andReturn("pragma") - .times(1); - EasyMock.expect(conn.getHeaderField("WWW-Authenticate")) - .andReturn("www-a").times(1); + EasyMock.expect(conn.getHeaderFields()).andReturn(new HashMap<>()); PowerMock.replay(conn); final HTTPResponse response = Whitebox.invokeMethod(request, "createResponse", conn, "content"); PowerMock.verifyAll(); Assert.assertNotNull(response); - Assert.assertEquals(response.getCacheControl(), "cc"); - Assert.assertEquals(response.getPragma(), "pragma"); - Assert.assertEquals(response.getWWWAuthenticate(), "www-a"); Assert.assertNull(response.getLocation(), "location.pl"); Assert.assertEquals(response.getContent(), "content"); } @@ -111,20 +104,12 @@ public void testCreateResponse() throws Exception { .andReturn("https://location.pl").times(1); EasyMock.expect(conn.getContentType()) .andReturn("application/x-www-form-urlencoded").times(1); - EasyMock.expect(conn.getHeaderField("Cache-Control")).andReturn("cc") - .times(1); - EasyMock.expect(conn.getHeaderField("Pragma")).andReturn("pragma") - .times(1); - EasyMock.expect(conn.getHeaderField("WWW-Authenticate")) - .andReturn("www-a").times(1); + EasyMock.expect(conn.getHeaderFields()).andReturn(new HashMap<>()); PowerMock.replay(conn); final HTTPResponse response = Whitebox.invokeMethod(request, "createResponse", conn, null); PowerMock.verifyAll(); Assert.assertNotNull(response); - Assert.assertEquals(response.getCacheControl(), "cc"); - Assert.assertEquals(response.getPragma(), "pragma"); - Assert.assertEquals(response.getWWWAuthenticate(), "www-a"); Assert.assertEquals(response.getLocation().getAuthority(), "location.pl"); Assert.assertEquals(response.getLocation().getScheme(), "https"); diff --git a/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java b/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java index 03a84181..099ceaf6 100644 --- a/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java @@ -43,40 +43,19 @@ import java.net.URISyntaxException; import java.net.URL; import java.util.Collections; +import java.util.HashMap; @Test(groups = { "checkin" }) @PrepareForTest(TokenErrorResponse.class) public class TokenRequestTest extends AbstractMsalTests { @Test - public void executeOAuthRequest_SCBadRequestErrorInteractionRequired_ClaimsChallengeExceptionThrown() + public void executeOAuthRequest_SCBadRequestErrorInteractionRequired_AuthenticationServiceException() throws SerializeException, ParseException, AuthenticationException, IOException, URISyntaxException { - PublicClientApplication app = new PublicClientApplication.Builder("id").build(); - - AuthorizationCodeParameters parameters = AuthorizationCodeParameters - .builder("code", new URI("http://my.redirect.com")) - .scopes(Collections.singleton("default-scope")) - .build(); - - final AuthorizationCodeRequest acr = new AuthorizationCodeRequest( - parameters, - app, - new RequestContext("id", - "corr-id", - PublicApi.ACQUIRE_TOKEN_BY_AUTHORIZATION_CODE)); - - ServiceBundle serviceBundle = new ServiceBundle( - null, - null, - null, - new TelemetryManager(null, false)); - - TokenRequest request = PowerMock.createPartialMock( - TokenRequest.class, new String[]{"toOauthHttpRequest"}, + TokenRequest request = createMockedTokenRequest(); - new URL("http://login.windows.net"), acr, serviceBundle); OAuthHttpRequest msalOAuthHttpRequest = PowerMock .createMock(OAuthHttpRequest.class); @@ -101,13 +80,80 @@ public void executeOAuthRequest_SCBadRequestErrorInteractionRequired_ClaimsChall try { request.executeOauthRequestAndProcessResponse(); - Assert.fail("Expected ClaimsChallengeException was not thrown"); - } catch (ClaimsChallengeException ex) { - Assert.assertEquals(claims.replace("\\", ""), ex.getClaims()); + Assert.fail("Expected AuthenticationServiceException was not thrown"); + } catch (AuthenticationServiceException ex) { + Assert.assertEquals(claims.replace("\\", ""), ex.claims()); + } + PowerMock.verifyAll(); + } + + @Test + public void executeOAuthRequest_SCBadRequestErrorInvalidGrant_SubErrorFiltered() + throws SerializeException, ParseException, AuthenticationException, + IOException, URISyntaxException { + + TokenRequest request = createMockedTokenRequest(); + + OAuthHttpRequest msalOAuthHttpRequest = PowerMock.createMock(OAuthHttpRequest.class); + + HTTPResponse httpResponse = new HTTPResponse(HTTPResponse.SC_BAD_REQUEST); + + String claims = "{\\\"access_token\\\":{\\\"polids\\\":{\\\"essential\\\":true,\\\"values\\\":[\\\"5ce770ea-8690-4747-aa73-c5b3cd509cd4\\\"]}}}"; + + String content = "{\"error\":\"invalid_grant\"," + + "\"error_description\":\"AADSTS65001: description\\r\\nCorrelation ID: 3a...5a\\r\\nTimestamp:2017-07-15 02:35:05Z\"," + + "\"error_codes\":[50076]," + + "\"timestamp\":\"2017-07-15 02:35:05Z\"," + + "\"trace_id\":\"0788...000\"," + + "\"correlation_id\":\"3a...95a\"," + + "\"suberror\":\"client_mismatch\"," + + "\"claims\":\"" + claims + "\"}"; + httpResponse.setContent(content); + httpResponse.setContentType(CommonContentTypes.APPLICATION_JSON); + + EasyMock.expect(request.toOauthHttpRequest()).andReturn(msalOAuthHttpRequest).times(1); + EasyMock.expect(msalOAuthHttpRequest.send()).andReturn(httpResponse).times(1); + + PowerMock.replay(request, msalOAuthHttpRequest); + + try { + request.executeOauthRequestAndProcessResponse(); + Assert.fail("Expected AuthenticationServiceException was not thrown"); + } catch (AuthenticationServiceException ex) { + Assert.assertEquals(claims.replace("\\", ""), ex.claims()); + Assert.assertEquals(ex.subError(), ""); } PowerMock.verifyAll(); } + private TokenRequest createMockedTokenRequest() throws URISyntaxException, MalformedURLException { + PublicClientApplication app = new PublicClientApplication.Builder("id").build(); + + AuthorizationCodeParameters parameters = AuthorizationCodeParameters + .builder("code", new URI("http://my.redirect.com")) + .scopes(Collections.singleton("default-scope")) + .build(); + + final AuthorizationCodeRequest acr = new AuthorizationCodeRequest( + parameters, + app, + new RequestContext("id", + "corr-id", + PublicApi.ACQUIRE_TOKEN_BY_AUTHORIZATION_CODE)); + + ServiceBundle serviceBundle = new ServiceBundle( + null, + null, + null, + new TelemetryManager(null, false)); + + return PowerMock.createPartialMock( + TokenRequest.class, new String[]{"toOauthHttpRequest"}, + new URL("http://login.windows.net"), + acr, + serviceBundle); + } + @Test public void testConstructor() throws MalformedURLException, URISyntaxException { @@ -298,47 +344,30 @@ public void testExecuteOAuth_Failure() throws SerializeException, .andReturn(msalOAuthHttpRequest).times(1); EasyMock.expect(msalOAuthHttpRequest.send()).andReturn(httpResponse) .times(1); - EasyMock.expect(httpResponse.getStatusCode()).andReturn(402).times(1); + EasyMock.expect(httpResponse.getStatusCode()).andReturn(402).times(2); + EasyMock.expect(httpResponse.getStatusMessage()).andReturn("403 Forbidden"); + EasyMock.expect(httpResponse.getHeaderMap()).andReturn(new HashMap<>()); + EasyMock.expect(httpResponse.getContent()).andReturn(TestConfiguration.HTTP_ERROR_RESPONSE); - final TokenErrorResponse errorResponse = PowerMock - .createMock(TokenErrorResponse.class); + final ErrorResponse errorResponse = PowerMock.createMock(ErrorResponse.class); - final ErrorObject errorObject = PowerMock.createMock(ErrorObject.class); - EasyMock.expect(errorObject.getCode()) - .andReturn("unknown").times(3); - EasyMock.expect(errorObject.getHTTPStatusCode()) - .andReturn(402).times(1); - - EasyMock.expect(errorResponse.getErrorObject()) - .andReturn(errorObject).times(1); + EasyMock.expect(errorResponse.error()).andReturn("invalid_request"); EasyMock.expect(httpResponse.getHeaderValue("User-Agent")).andReturn(null); EasyMock.expect(httpResponse.getHeaderValue("x-ms-request-id")).andReturn(null); EasyMock.expect(httpResponse.getHeaderValue("x-ms-clitelem")).andReturn(null); EasyMock.expect(httpResponse.getStatusCode()).andReturn(402).times(1); - - PowerMock.mockStaticPartial(TokenErrorResponse.class, "parse"); - PowerMock.createPartialMock(TokenErrorResponse.class, "parse"); - EasyMock.expect(TokenErrorResponse.parse(httpResponse)) - .andReturn(errorResponse).times(1); - - final JSONObject jsonObj = PowerMock.createMock(JSONObject.class); - EasyMock.expect(jsonObj.toJSONString()) - .andReturn(TestConfiguration.HTTP_ERROR_RESPONSE).times(1); - EasyMock.expect(errorResponse.toJSONObject()).andReturn(jsonObj) - .times(1); - PowerMock.replay(request, msalOAuthHttpRequest, httpResponse, - TokenErrorResponse.class, errorObject, jsonObj, errorResponse); + TokenErrorResponse.class, errorResponse); try { request.executeOauthRequestAndProcessResponse(); PowerMock.verifyAll(); } finally { PowerMock.reset(request, msalOAuthHttpRequest, httpResponse, - TokenErrorResponse.class, jsonObj, errorResponse); + TokenErrorResponse.class, errorResponse); } } } \ No newline at end of file From 9405bdcb393d910885afe91d0564e31af94c7c44 Mon Sep 17 00:00:00 2001 From: sgonzalezMSFT Date: Tue, 25 Jun 2019 12:57:20 -0700 Subject: [PATCH 07/16] Add misssing license headers --- .../msal4j/AuthenticationClientException.java | 23 +++++++++++++++++++ .../AuthenticationServiceException.java | 23 +++++++++++++++++++ .../microsoft/aad/msal4j/ErrorResponse.java | 3 --- 3 files changed, 46 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationClientException.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationClientException.java index d727d4c9..6bdc1e93 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationClientException.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationClientException.java @@ -1,3 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package com.microsoft.aad.msal4j; /** diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationServiceException.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationServiceException.java index 2b8ff17a..6d8f2290 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationServiceException.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationServiceException.java @@ -1,3 +1,26 @@ +// Copyright (c) Microsoft Corporation. +// All rights reserved. +// +// This code is licensed under the MIT License. +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files(the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions : +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + package com.microsoft.aad.msal4j; import lombok.Getter; diff --git a/src/main/java/com/microsoft/aad/msal4j/ErrorResponse.java b/src/main/java/com/microsoft/aad/msal4j/ErrorResponse.java index 488d0eb3..e0f61fe4 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ErrorResponse.java +++ b/src/main/java/com/microsoft/aad/msal4j/ErrorResponse.java @@ -60,6 +60,3 @@ class ErrorResponse { @SerializedName("claims") private String claims; } - - - From 96df50e497d22faae2d2cb3aff7a21ebc976510e Mon Sep 17 00:00:00 2001 From: SomkaPe Date: Tue, 25 Jun 2019 16:46:00 -0700 Subject: [PATCH 08/16] Pesomka/client cred silent (#68) silent flow support for client cred grant --- .../ClientCredentialsIT.java | 20 +- .../msal4j/AcquireTokenSilentSupplier.java | 15 +- .../msal4j/AuthenticationResultSupplier.java | 11 +- .../com/microsoft/aad/msal4j/Authority.java | 6 + .../aad/msal4j/ClientApplicationBase.java | 5 +- .../aad/msal4j/OAuthAuthorizationGrant.java | 1 + .../aad/msal4j/SilentParameters.java | 9 +- .../com/microsoft/aad/msal4j/TokenCache.java | 264 ++++++++++-------- .../microsoft/aad/msal4j/TokenRequest.java | 30 +- .../ClientCredentialGrant.java | 28 +- .../aad/msal4j/CacheFormatTests.java | 2 +- .../aad/msal4j/DeviceCodeFlowTest.java | 2 +- .../aad/msal4j/TokenRequestTest.java | 12 +- 13 files changed, 240 insertions(+), 165 deletions(-) diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java index 367c2359..9a15a655 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java @@ -38,6 +38,7 @@ import java.security.cert.X509Certificate; import java.util.Collections; +import static com.microsoft.aad.msal4j.TestConstants.GRAPH_DEFAULT_SCOPE; import static com.microsoft.aad.msal4j.TestConstants.KEYVAULT_DEFAULT_SCOPE; @Test @@ -72,8 +73,23 @@ private void assertAcquireTokenCommon(String clientId, IClientCredential credent Assert.assertNotNull(result); Assert.assertNotNull(result.accessToken()); - // TODO AuthenticationResult should have an getAccountInfo API - // Assert.assertEquals(labResponse.getUser().getUpn(), result.getAccountInfo().getUsername()); + + String cachedAt = result.accessToken(); + + result = cca.acquireTokenSilently(SilentParameters + .builder(Collections.singleton(GRAPH_DEFAULT_SCOPE)) + .build()) + .get(); + + Assert.assertNull(result); + + result = cca.acquireTokenSilently(SilentParameters + .builder(Collections.singleton(KEYVAULT_DEFAULT_SCOPE)) + .build()) + .get(); + + Assert.assertNotNull(result); + Assert.assertEquals(result.accessToken(), cachedAt); } diff --git a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenSilentSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenSilentSupplier.java index b5e6c87c..73c42640 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenSilentSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenSilentSupplier.java @@ -23,9 +23,6 @@ package com.microsoft.aad.msal4j; -import java.util.Optional; -import java.util.Set; - class AcquireTokenSilentSupplier extends AuthenticationResultSupplier { private SilentRequest silentRequest; @@ -44,7 +41,17 @@ AuthenticationResult execute() throws Exception { getAuthorityWithPrefNetworkHost(silentRequest.requestAuthority().authority()); } - AuthenticationResult res = clientApplication.tokenCache.getAuthenticationResult( + AuthenticationResult res; + + if(silentRequest.parameters().account() == null){ + res = clientApplication.tokenCache.getCachedAuthenticationResult( + requestAuthority, + silentRequest.parameters().scopes(), + clientApplication.clientId()); + return StringHelper.isBlank(res.accessToken()) ? null : res; + } + + res = clientApplication.tokenCache.getCachedAuthenticationResult( silentRequest.parameters().account(), requestAuthority, silentRequest.parameters().scopes(), diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java index a5136707..92ee6ee5 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java @@ -76,11 +76,14 @@ public IAuthenticationResult get() { true)) { try { result = execute(); - logResult(result, msalRequest.headers()); - apiEvent.setWasSuccessful(true); - if (result.account() != null) { - apiEvent.setTenantId(result.accountCacheEntity().realm()); + + if(result != null){ + logResult(result, msalRequest.headers()); + + if (result.account() != null) { + apiEvent.setTenantId(result.accountCacheEntity().realm()); + } } } catch(Exception ex) { if (ex instanceof AuthenticationException) { diff --git a/src/main/java/com/microsoft/aad/msal4j/Authority.java b/src/main/java/com/microsoft/aad/msal4j/Authority.java index 10b84a51..9ca5be80 100644 --- a/src/main/java/com/microsoft/aad/msal4j/Authority.java +++ b/src/main/java/com/microsoft/aad/msal4j/Authority.java @@ -26,6 +26,8 @@ import lombok.AccessLevel; import lombok.Getter; import lombok.experimental.Accessors; + +import java.net.MalformedURLException; import java.net.URL; /** @@ -54,6 +56,10 @@ abstract class Authority { String tokenEndpoint; + URL tokenEndpointUrl() throws MalformedURLException { + return new URL(tokenEndpoint); + } + Authority(URL canonicalAuthorityUrl){ this.canonicalAuthorityUrl = canonicalAuthorityUrl; this.authorityType = detectAuthorityType(canonicalAuthorityUrl); diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java b/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java index d13f5707..38ef29a9 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java @@ -140,8 +140,7 @@ AuthenticationResult acquireTokenCommon(MsalRequest msalRequest, Authority reque headers.getHeaderCorrelationIdValue())); } - URL url = new URL(requestAuthority.tokenEndpoint()); - TokenRequest request = new TokenRequest(url, msalRequest, serviceBundle); + TokenRequest request = new TokenRequest(requestAuthority, msalRequest, serviceBundle); AuthenticationResult result = request.executeOauthRequestAndProcessResponse(); @@ -150,7 +149,7 @@ AuthenticationResult acquireTokenCommon(MsalRequest msalRequest, Authority reque } else { InstanceDiscoveryMetadataEntry instanceDiscoveryMetadata = AadInstanceDiscovery.GetMetadataEntry - (url, validateAuthority, msalRequest, serviceBundle); + (requestAuthority.canonicalAuthorityUrl(), validateAuthority, msalRequest, serviceBundle); tokenCache.saveTokens(request, result, instanceDiscoveryMetadata.preferredCache); } diff --git a/src/main/java/com/microsoft/aad/msal4j/OAuthAuthorizationGrant.java b/src/main/java/com/microsoft/aad/msal4j/OAuthAuthorizationGrant.java index c29bcebd..211694d5 100644 --- a/src/main/java/com/microsoft/aad/msal4j/OAuthAuthorizationGrant.java +++ b/src/main/java/com/microsoft/aad/msal4j/OAuthAuthorizationGrant.java @@ -55,6 +55,7 @@ private OAuthAuthorizationGrant() { if (!StringHelper.isBlank(scopes)) { + this.scopes = scopes; params.put(SCOPE_PARAM_NAME, Collections.singletonList(String.join(" ",params.get(SCOPE_PARAM_NAME)) + SCOPES_DELIMITER + scopes)); } diff --git a/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java b/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java index 8289e9a4..fb10777e 100644 --- a/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java @@ -29,6 +29,7 @@ import java.util.Set; import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotEmpty; +import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotNull; @Builder @Accessors(fluent = true) @@ -39,7 +40,6 @@ public class SilentParameters { @NonNull private Set scopes; - @NonNull private IAccount account; private String authorityUrl; @@ -53,10 +53,17 @@ private static SilentParametersBuilder builder() { public static SilentParametersBuilder builder(Set scopes, IAccount account) { + validateNotNull("account", account); validateNotEmpty("scopes", scopes); return builder() .scopes(scopes) .account(account); } + + public static SilentParametersBuilder builder(Set scopes) { + validateNotEmpty("scopes", scopes); + + return builder().scopes(scopes); + } } diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenCache.java b/src/main/java/com/microsoft/aad/msal4j/TokenCache.java index 3aaf8914..553c8ebe 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenCache.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenCache.java @@ -145,53 +145,61 @@ public String serialize() { return new GsonBuilder().create().toJson(this); } - protected void saveTokens - (TokenRequest tokenRequest, AuthenticationResult authenticationResult, String environment){ - - if(tokenCacheAccessAspect != null){ - ITokenCacheAccessContext context = TokenCacheAccessContext.builder(). - clientId(tokenRequest.getMsalRequest().application().clientId()). - tokenCache(this). - build(); - tokenCacheAccessAspect.beforeCacheAccess(context); - } + private class CacheAspect implements AutoCloseable{ + ITokenCacheAccessContext context; - if(!StringHelper.isBlank(authenticationResult.accessToken())){ - AccessTokenCacheEntity atEntity = createAccessTokenCacheEntity - (tokenRequest, authenticationResult, environment); - accessTokens.put(atEntity.getKey(), atEntity); + CacheAspect(ITokenCacheAccessContext context){ + if(tokenCacheAccessAspect != null){ + this.context = context; + tokenCacheAccessAspect.beforeCacheAccess(context); + } } - if(!StringHelper.isBlank(authenticationResult.familyId())){ - AppMetadataCacheEntity appMetadataCacheEntity = - createAppMetadataCacheEntity(tokenRequest, authenticationResult, environment); - appMetadata.put(appMetadataCacheEntity.getKey(), appMetadataCacheEntity); + @Override + public void close() { + if(tokenCacheAccessAspect != null){ + tokenCacheAccessAspect.afterCacheAccess(context); + } } - if(!StringHelper.isBlank(authenticationResult.refreshToken())){ - RefreshTokenCacheEntity rtEntity = createRefreshTokenCacheEntity - (tokenRequest, authenticationResult, environment); + } - rtEntity.family_id(authenticationResult.familyId()); + protected void saveTokens + (TokenRequest tokenRequest, AuthenticationResult authenticationResult, String environment) { + + try (CacheAspect cacheAspect = new CacheAspect( + TokenCacheAccessContext.builder(). + clientId(tokenRequest.getMsalRequest().application().clientId()). + tokenCache(this). + hasCacheChanged(true).build())) { + + if (!StringHelper.isBlank(authenticationResult.accessToken())) { + AccessTokenCacheEntity atEntity = createAccessTokenCacheEntity + (tokenRequest, authenticationResult, environment); + accessTokens.put(atEntity.getKey(), atEntity); + } + if (!StringHelper.isBlank(authenticationResult.familyId())) { + AppMetadataCacheEntity appMetadataCacheEntity = + createAppMetadataCacheEntity(tokenRequest, authenticationResult, environment); - refreshTokens.put(rtEntity.getKey(), rtEntity); - } - if(!StringHelper.isBlank(authenticationResult.idToken())){ - IdTokenCacheEntity idTokenEntity = createIdTokenCacheEntity - (tokenRequest, authenticationResult, environment); - idTokens.put(idTokenEntity.getKey(), idTokenEntity); - - AccountCacheEntity accountCacheEntity = authenticationResult.accountCacheEntity(); - accountCacheEntity.environment(environment); - accounts.put(accountCacheEntity.getKey(), accountCacheEntity); - } + appMetadata.put(appMetadataCacheEntity.getKey(), appMetadataCacheEntity); + } + if (!StringHelper.isBlank(authenticationResult.refreshToken())) { + RefreshTokenCacheEntity rtEntity = createRefreshTokenCacheEntity + (tokenRequest, authenticationResult, environment); - if(tokenCacheAccessAspect != null){ - ITokenCacheAccessContext context = TokenCacheAccessContext.builder(). - clientId(tokenRequest.getMsalRequest().application().clientId()). - tokenCache(this). - hasCacheChanged(true). - build(); - tokenCacheAccessAspect.afterCacheAccess(context); + rtEntity.family_id(authenticationResult.familyId()); + + refreshTokens.put(rtEntity.getKey(), rtEntity); + } + if (!StringHelper.isBlank(authenticationResult.idToken())) { + IdTokenCacheEntity idTokenEntity = createIdTokenCacheEntity + (tokenRequest, authenticationResult, environment); + idTokens.put(idTokenEntity.getKey(), idTokenEntity); + + AccountCacheEntity accountCacheEntity = authenticationResult.accountCacheEntity(); + accountCacheEntity.environment(environment); + accounts.put(accountCacheEntity.getKey(), accountCacheEntity); + } } } @@ -231,6 +239,9 @@ static AccessTokenCacheEntity createAccessTokenCacheEntity(TokenRequest tokenReq if (idTokenObj != null) { at.realm(idTokenObj.tenantIdentifier); } + else{ + at.realm(tokenRequest.requestAuthority.tenant()); + } String scopes = !StringHelper.isBlank(authenticationResult.scopes()) ? authenticationResult.scopes() : tokenRequest.getMsalRequest().msalAuthorizationGrant().getScopes(); @@ -281,25 +292,16 @@ static AppMetadataCacheEntity createAppMetadataCacheEntity(TokenRequest tokenReq } protected Set getAccounts(String clientId, Set environmentAliases) { - - ITokenCacheAccessContext context = null; - if(tokenCacheAccessAspect != null){ - context = TokenCacheAccessContext.builder(). - clientId(clientId). - tokenCache(this). - build(); - tokenCacheAccessAspect.beforeCacheAccess(context); + try (CacheAspect cacheAspect = new CacheAspect( + TokenCacheAccessContext.builder(). + clientId(clientId). + tokenCache(this). + build())) { + + return accounts.values().stream(). + filter(acc -> environmentAliases.contains(acc.environment())). + collect(Collectors.mapping(AccountCacheEntity::toAccount, Collectors.toSet())); } - - Set result = accounts.values().stream(). - filter(acc -> environmentAliases.contains(acc.environment())). - collect(Collectors.mapping(AccountCacheEntity::toAccount, Collectors.toSet())); - - if(tokenCacheAccessAspect != null){ - tokenCacheAccessAspect.afterCacheAccess(context); - } - - return result; } /** @@ -337,19 +339,14 @@ Set getFamilyClientIds(String familyId, Set environmentAliases) * @param environmentAliases environment aliases */ protected void removeAccount(String clientId, IAccount account, Set environmentAliases) { - ITokenCacheAccessContext context = null; - if(tokenCacheAccessAspect != null){ - context = TokenCacheAccessContext.builder(). - clientId(clientId). - tokenCache(this). - build(); - tokenCacheAccessAspect.beforeCacheAccess(context); - } - - removeAccount(account, environmentAliases); - - if(tokenCacheAccessAspect != null){ - tokenCacheAccessAspect.afterCacheAccess(context); + try (CacheAspect cacheAspect = new CacheAspect( + TokenCacheAccessContext.builder(). + clientId(clientId). + tokenCache(this). + hasCacheChanged(true). + build())) { + + removeAccount(account, environmentAliases); } } @@ -399,6 +396,21 @@ boolean isMatchingScopes(AccessTokenCacheEntity accessTokenCacheEntity, Set getApplicationAccessTokenCacheEntity + (Authority authority, Set scopes, String clientId, + Set environmentAliases){ + long currTimeStampSec = new Date().getTime()/1000; + + return accessTokens.values(). + stream().filter + (accessToken -> environmentAliases.contains(accessToken.environment) && + Long.parseLong(accessToken.expiresOn()) > currTimeStampSec + MIN_ACCESS_TOKEN_EXPIRE_IN_SEC && + accessToken.realm.equals(authority.tenant()) && + accessToken.clientId.equals(clientId) && + isMatchingScopes(accessToken, scopes) + ).findAny(); + } + Optional getIdTokenCacheEntity (IAccount account, Authority authority, String clientId, Set environmentAliases){ return idTokens.values().stream().filter @@ -438,69 +450,89 @@ boolean isMatchingScopes(AccessTokenCacheEntity accessTokenCacheEntity, Set scopes, String clientId) { - ITokenCacheAccessContext context = null; - if(tokenCacheAccessAspect != null){ - context = TokenCacheAccessContext.builder(). - clientId(clientId). - tokenCache(this). - account(account). - build(); - tokenCacheAccessAspect.beforeCacheAccess(context); - } + AuthenticationResult.AuthenticationResultBuilder builder = AuthenticationResult.builder(); + builder.environment(authority.host()); Set environmentAliases = AadInstanceDiscovery.cache.get(account.environment()).aliases(); - Optional accountCacheEntity = - getAccountCacheEntity(account, environmentAliases); + try (CacheAspect cacheAspect = new CacheAspect( + TokenCacheAccessContext.builder(). + clientId(clientId). + tokenCache(this). + account(account). + build())) { + + Optional accountCacheEntity = + getAccountCacheEntity(account, environmentAliases); - Optional atCacheEntity = - getAccessTokenCacheEntity(account, authority, scopes, clientId, environmentAliases); + Optional atCacheEntity = + getAccessTokenCacheEntity(account, authority, scopes, clientId, environmentAliases); - Optional idTokenCacheEntity = - getIdTokenCacheEntity(account, authority, clientId, environmentAliases); + Optional idTokenCacheEntity = + getIdTokenCacheEntity(account, authority, clientId, environmentAliases); - Optional rtCacheEntity; + Optional rtCacheEntity; - if (!StringHelper.isBlank(getApplicationFamilyId(clientId, environmentAliases))) { - rtCacheEntity = getAnyFamilyRefreshTokenCacheEntity(account, environmentAliases); - if(!rtCacheEntity.isPresent()){ + if (!StringHelper.isBlank(getApplicationFamilyId(clientId, environmentAliases))) { + rtCacheEntity = getAnyFamilyRefreshTokenCacheEntity(account, environmentAliases); + if (!rtCacheEntity.isPresent()) { + rtCacheEntity = getRefreshTokenCacheEntity(account, clientId, environmentAliases); + } + } else { rtCacheEntity = getRefreshTokenCacheEntity(account, clientId, environmentAliases); + if (!rtCacheEntity.isPresent()) { + rtCacheEntity = getAnyFamilyRefreshTokenCacheEntity(account, environmentAliases); + } } - } - else{ - rtCacheEntity = getRefreshTokenCacheEntity(account, clientId, environmentAliases); - if(!rtCacheEntity.isPresent()){ - rtCacheEntity = getAnyFamilyRefreshTokenCacheEntity(account, environmentAliases); + + if (atCacheEntity.isPresent()) { + builder. + accessToken(atCacheEntity.get().secret). + expiresOn(Long.parseLong(atCacheEntity.get().expiresOn())); + } + if (idTokenCacheEntity.isPresent()) { + builder. + idToken(idTokenCacheEntity.get().secret); + } + if (rtCacheEntity.isPresent()) { + builder. + refreshToken(rtCacheEntity.get().secret); + } + if (accountCacheEntity.isPresent()) { + builder. + accountCacheEntity(accountCacheEntity.get()); } } - if(tokenCacheAccessAspect != null){ - tokenCacheAccessAspect.afterCacheAccess(context); - } + return builder.build(); + } + AuthenticationResult getCachedAuthenticationResult + (Authority authority, Set scopes, String clientId) { AuthenticationResult.AuthenticationResultBuilder builder = AuthenticationResult.builder(); - if (atCacheEntity.isPresent()) { - builder. - accessToken(atCacheEntity.get().secret). - expiresOn(Long.parseLong(atCacheEntity.get().expiresOn())); - } - if (idTokenCacheEntity.isPresent()) { - builder. - idToken(idTokenCacheEntity.get().secret); - } - if (rtCacheEntity.isPresent()) { - builder. - refreshToken(rtCacheEntity.get().secret); - } - if (accountCacheEntity.isPresent()) { - builder. - accountCacheEntity(accountCacheEntity.get()); - } + + Set environmentAliases = AadInstanceDiscovery.cache.get(authority.host).aliases(); builder.environment(authority.host()); + try (CacheAspect cacheAspect = new CacheAspect( + TokenCacheAccessContext.builder(). + clientId(clientId). + tokenCache(this). + build())) { + + Optional atCacheEntity = + getApplicationAccessTokenCacheEntity(authority, scopes, clientId, environmentAliases); + + if (atCacheEntity.isPresent()) { + builder. + accessToken(atCacheEntity.get().secret). + expiresOn(Long.parseLong(atCacheEntity.get().expiresOn())); + } + } + return builder.build(); } } diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java b/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java index b1e95de8..15c41389 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java @@ -24,6 +24,7 @@ package com.microsoft.aad.msal4j; import java.io.IOException; +import java.net.MalformedURLException; import java.net.URISyntaxException; import java.net.URL; import java.util.Date; @@ -51,12 +52,12 @@ class TokenRequest { Logger log = LoggerFactory.getLogger(TokenRequest.class); - private final URL url; + final Authority requestAuthority; private final MsalRequest msalRequest; private final ServiceBundle serviceBundle; - TokenRequest(final URL url, MsalRequest msalRequest, final ServiceBundle serviceBundle) { - this.url = url; + TokenRequest(Authority requestAuthority, MsalRequest msalRequest, ServiceBundle serviceBundle) { + this.requestAuthority = requestAuthority; this.serviceBundle = serviceBundle; this.msalRequest = msalRequest; } @@ -89,8 +90,7 @@ AuthenticationResult executeOauthRequestAndProcessResponse() addResponseHeadersToHttpEvent(httpEvent, httpResponse); if (httpResponse.getStatusCode() == HTTPResponse.SC_OK) { - final TokenResponse response = - TokenResponse.parseHttpResponse(httpResponse); + final TokenResponse response = TokenResponse.parseHttpResponse(httpResponse); OIDCTokens tokens = response.getOIDCTokens(); String refreshToken = null; @@ -113,13 +113,13 @@ AuthenticationResult executeOauthRequestAndProcessResponse() accountCacheEntity = AccountCacheEntity.create( response.getClientInfo(), - url.getHost(), + requestAuthority.host(), idToken, authority.policy); } else { accountCacheEntity = AccountCacheEntity.create( response.getClientInfo(), - url.getHost(), + requestAuthority.host(), idToken); } } @@ -131,7 +131,7 @@ AuthenticationResult executeOauthRequestAndProcessResponse() refreshToken(refreshToken). familyId(response.getFoci()). idToken(tokens.getIDTokenString()). - environment(url.getHost()). + environment(requestAuthority.host()). expiresOn(currTimestampSec + response.getExpiresIn()). extExpiresOn(response.getExtExpiresIn() > 0 ? currTimestampSec + response.getExtExpiresIn() : 0). accountCacheEntity(accountCacheEntity). @@ -194,13 +194,13 @@ private void addResponseHeadersToHttpEvent(HttpEvent httpEvent, HTTPResponse htt } } - private HttpEvent createHttpEvent() { + private HttpEvent createHttpEvent() throws MalformedURLException { HttpEvent httpEvent = new HttpEvent(); httpEvent.setHttpMethod("POST"); try { - httpEvent.setHttpPath(url.toURI()); - if(!StringHelper.isBlank(url.getQuery())) - httpEvent.setQueryParameters(url.getQuery()); + httpEvent.setHttpPath(requestAuthority.tokenEndpointUrl().toURI()); + if(!StringHelper.isBlank(requestAuthority.tokenEndpointUrl().getQuery())) + httpEvent.setQueryParameters(requestAuthority.tokenEndpointUrl().getQuery()); } catch(URISyntaxException ex){ log.warn(LogHelper.createMessage("Setting URL telemetry fields failed: " + LogHelper.getPiiScrubbedDetails(ex), @@ -222,15 +222,15 @@ private String getClaims(String httpResponseContentStr) { * @return * @throws SerializeException */ - OAuthHttpRequest toOauthHttpRequest() throws SerializeException { + OAuthHttpRequest toOauthHttpRequest() throws SerializeException, MalformedURLException { - if (this.url == null) { + if (requestAuthority.tokenEndpointUrl() == null) { throw new SerializeException("The endpoint URI is not specified"); } final OAuthHttpRequest oauthHttpRequest = new OAuthHttpRequest( HTTPRequest.Method.POST, - this.url, + requestAuthority.tokenEndpointUrl(), msalRequest.headers().getReadonlyHeaderMap(), this.serviceBundle); oauthHttpRequest.setContentType(CommonContentTypes.APPLICATION_URLENCODED); diff --git a/src/samples/confidential-client/ClientCredentialGrant.java b/src/samples/confidential-client/ClientCredentialGrant.java index 23945b0d..eedab0a8 100644 --- a/src/samples/confidential-client/ClientCredentialGrant.java +++ b/src/samples/confidential-client/ClientCredentialGrant.java @@ -21,13 +21,12 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. -import com.microsoft.aad.msal4j.AuthenticationResult; -import com.microsoft.aad.msal4j.ClientCredentialFactory; -import com.microsoft.aad.msal4j.ClientCredentialParameters; -import com.microsoft.aad.msal4j.ConfidentialClientApplication; +import com.microsoft.aad.msal4j.*; import java.util.Collections; import java.util.concurrent.CompletableFuture; +import java.util.function.BiConsumer; +import java.util.function.BiFunction; class ClientCredentialGrant { @@ -43,25 +42,30 @@ private static void getAccessTokenByClientCredentialGrant() throws Exception { .authority(TestData.TENANT_SPECIFIC_AUTHORITY) .build(); - ClientCredentialParameters parameters = ClientCredentialParameters.builder( + ClientCredentialParameters clientCredentialParam = ClientCredentialParameters.builder( Collections.singleton(TestData.GRAPH_DEFAULT_SCOPE)) .build(); - CompletableFuture future = app.acquireToken(parameters); + CompletableFuture future = app.acquireToken(clientCredentialParam); - future.handle((res, ex) -> { + BiConsumer processAuthResult = (res, ex) -> { if (ex != null) { System.out.println("Oops! We have an exception - " + ex.getMessage()); - return "Unknown!"; } System.out.println("Returned ok - " + res); - System.out.println("Access Token - " + res.accessToken()); - System.out.println("Refresh Token - " + res.refreshToken()); System.out.println("ID Token - " + res.idToken()); - return res; - }); + }; + + future.whenCompleteAsync(processAuthResult); + future.join(); + + SilentParameters silentParameters = + SilentParameters.builder(Collections.singleton(TestData.GRAPH_DEFAULT_SCOPE)).build(); + + future = app.acquireTokenSilently(silentParameters); + future.whenCompleteAsync(processAuthResult); future.join(); } } diff --git a/src/test/java/com/microsoft/aad/msal4j/CacheFormatTests.java b/src/test/java/com/microsoft/aad/msal4j/CacheFormatTests.java index 6d0c6c12..56b8c0e1 100644 --- a/src/test/java/com/microsoft/aad/msal4j/CacheFormatTests.java +++ b/src/test/java/com/microsoft/aad/msal4j/CacheFormatTests.java @@ -167,7 +167,7 @@ public void tokenCacheEntitiesFormatTest(String folder) throws URISyntaxExceptio TokenRequest request = PowerMock.createPartialMock( TokenRequest.class, new String[] { "toOauthHttpRequest" }, - new URL(AUTHORIZE_REQUEST_URL), msalRequest, serviceBundle); + new AADAuthority(new URL(AUTHORIZE_REQUEST_URL)), msalRequest, serviceBundle); OAuthHttpRequest msalOAuthHttpRequest = PowerMock.createMock(OAuthHttpRequest.class); diff --git a/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java b/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java index ee738ea7..77362446 100644 --- a/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java @@ -235,7 +235,7 @@ public void executeAcquireDeviceCode_AuthenticaionPendingErrorReturned_Authentic TokenRequest request = PowerMock.createPartialMock( TokenRequest.class, new String[]{"toOauthHttpRequest"}, - new URL("http://login.windows.net"), + new AADAuthority(new URL(TestConstants.ORGANIZATIONS_AUTHORITY)), dcr, new ServiceBundle(null, null, null, telemetryManager)); OAuthHttpRequest msalOAuthHttpRequest = PowerMock.createMock(OAuthHttpRequest.class); diff --git a/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java b/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java index a6570e7b..87f65eb3 100644 --- a/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java @@ -75,8 +75,8 @@ public void executeOAuthRequest_SCBadRequestErrorInteractionRequired_ClaimsChall TokenRequest request = PowerMock.createPartialMock( TokenRequest.class, new String[]{"toOauthHttpRequest"}, + new AADAuthority(new URL(TestConstants.ORGANIZATIONS_AUTHORITY)), acr, serviceBundle); - new URL("http://login.windows.net"), acr, serviceBundle); OAuthHttpRequest msalOAuthHttpRequest = PowerMock .createMock(OAuthHttpRequest.class); @@ -128,7 +128,7 @@ public void testConstructor() throws MalformedURLException, PublicApi.ACQUIRE_TOKEN_BY_AUTHORIZATION_CODE)); final TokenRequest request = new TokenRequest( - new URL("http://login.windows.net"), + new AADAuthority(new URL(TestConstants.ORGANIZATIONS_AUTHORITY)), acr, new ServiceBundle(null, null, null, null)); Assert.assertNotNull(request); @@ -154,7 +154,7 @@ public void testToOAuthRequestNonEmptyCorrelationId() PublicApi.ACQUIRE_TOKEN_BY_AUTHORIZATION_CODE)); TokenRequest request = new TokenRequest( - new URL("http://login.windows.net"), + new AADAuthority(new URL(TestConstants.ORGANIZATIONS_AUTHORITY)), acr, new ServiceBundle(null, null, null, null)); Assert.assertNotNull(request); @@ -187,7 +187,7 @@ public void testToOAuthRequestNullCorrelationId_NullClientAuth() PublicApi.ACQUIRE_TOKEN_BY_AUTHORIZATION_CODE)); final TokenRequest request = new TokenRequest( - new URL("http://login.windows.net"), + new AADAuthority(new URL(TestConstants.ORGANIZATIONS_AUTHORITY)), acr, new ServiceBundle(null, null, null, null)); Assert.assertNotNull(request); @@ -222,8 +222,8 @@ public void testExecuteOAuth_Success() throws SerializeException, ParseException final TokenRequest request = PowerMock.createPartialMock( TokenRequest.class, new String[] { "toOauthHttpRequest" }, + new AADAuthority(new URL(TestConstants.ORGANIZATIONS_AUTHORITY)), acr, serviceBundle); - new URL("http://login.windows.net"), acr, serviceBundle); final OAuthHttpRequest msalOAuthHttpRequest = PowerMock .createMock(OAuthHttpRequest.class); @@ -288,7 +288,7 @@ public void testExecuteOAuth_Failure() throws SerializeException, final TokenRequest request = PowerMock.createPartialMock( TokenRequest.class, new String[] { "toOauthHttpRequest" }, - new URL("http://login.windows.net"), acr, serviceBundle); + new AADAuthority(new URL(TestConstants.ORGANIZATIONS_AUTHORITY)), acr, serviceBundle); final OAuthHttpRequest msalOAuthHttpRequest = PowerMock .createMock(OAuthHttpRequest.class); From 0ff475b46d3a5ed3a0679add708edec41e39eac4 Mon Sep 17 00:00:00 2001 From: sgonzalezMSFT Date: Thu, 27 Jun 2019 15:46:01 -0700 Subject: [PATCH 09/16] Update JavaDoc --- .../com/microsoft/aad/msal4j/Account.java | 4 + .../aad/msal4j/AppMetadataCacheEntity.java | 5 +- .../msal4j/AuthorizationCodeParameters.java | 11 +++ .../aad/msal4j/ClientApplicationBase.java | 77 +++++++++---------- .../microsoft/aad/msal4j/ClientAssertion.java | 5 +- .../aad/msal4j/ClientCredentialFactory.java | 29 ++++++- .../msal4j/ClientCredentialParameters.java | 9 +++ .../microsoft/aad/msal4j/ClientSecret.java | 9 +-- .../msal4j/ConfidentialClientApplication.java | 4 + .../aad/msal4j/CredentialTypeEnum.java | 2 +- .../com/microsoft/aad/msal4j/DeviceCode.java | 16 ++-- .../aad/msal4j/DeviceCodeFlowParameters.java | 10 +++ .../com/microsoft/aad/msal4j/IAccount.java | 9 ++- .../aad/msal4j/IAuthenticationResult.java | 4 +- .../aad/msal4j/IClientApplicationBase.java | 33 ++++---- .../aad/msal4j/IClientCredential.java | 3 + .../IConfidentialClientApplication.java | 32 ++++---- .../aad/msal4j/IPublicClientApplication.java | 33 ++++---- .../com/microsoft/aad/msal4j/ITokenCache.java | 2 +- .../aad/msal4j/ITokenCacheAccessAspect.java | 4 +- .../aad/msal4j/ITokenCacheAccessContext.java | 2 +- .../microsoft/aad/msal4j/IUserAssertion.java | 4 + ...gratedWindowsAuthenticationParameters.java | 11 +++ .../aad/msal4j/OnBehalfOfParameters.java | 10 +++ .../aad/msal4j/PublicClientApplication.java | 5 ++ .../aad/msal4j/RefreshTokenParameters.java | 11 +++ .../aad/msal4j/SilentParameters.java | 11 +++ .../com/microsoft/aad/msal4j/TokenCache.java | 7 ++ .../aad/msal4j/TokenCacheAccessContext.java | 3 + .../microsoft/aad/msal4j/UserAssertion.java | 5 +- .../msal4j/UserNamePasswordParameters.java | 11 +++ 31 files changed, 261 insertions(+), 120 deletions(-) diff --git a/src/main/java/com/microsoft/aad/msal4j/Account.java b/src/main/java/com/microsoft/aad/msal4j/Account.java index 3b139a0d..015d478e 100644 --- a/src/main/java/com/microsoft/aad/msal4j/Account.java +++ b/src/main/java/com/microsoft/aad/msal4j/Account.java @@ -28,6 +28,10 @@ import lombok.Setter; import lombok.experimental.Accessors; +/** + * Representation of a single user account. If modifying this object, ensure it is compliant with + * cache persistent model + */ @Accessors(fluent = true) @Getter @Setter diff --git a/src/main/java/com/microsoft/aad/msal4j/AppMetadataCacheEntity.java b/src/main/java/com/microsoft/aad/msal4j/AppMetadataCacheEntity.java index 521f133f..9fd7fb4b 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AppMetadataCacheEntity.java +++ b/src/main/java/com/microsoft/aad/msal4j/AppMetadataCacheEntity.java @@ -31,10 +31,13 @@ import java.util.ArrayList; import java.util.List; +/** + * Representation of application metadata. + */ @Accessors(fluent = true) @Getter @Setter -public class AppMetadataCacheEntity { +class AppMetadataCacheEntity { public static final String APP_METADATA_CACHE_ENTITY_ID = "appmetadata"; diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthorizationCodeParameters.java b/src/main/java/com/microsoft/aad/msal4j/AuthorizationCodeParameters.java index b7197fbd..f3ca7112 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthorizationCodeParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthorizationCodeParameters.java @@ -31,6 +31,11 @@ import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotBlank; +/** + * Object containing parameters for authorization code flow. Can be used as parameter to + * {@link PublicClientApplication#acquireToken(AuthorizationCodeParameters)} or to + * {@link ConfidentialClientApplication#acquireToken(AuthorizationCodeParameters)} + */ @Builder @Accessors(fluent = true) @Getter @@ -50,6 +55,12 @@ private static AuthorizationCodeParametersBuilder builder() { return new AuthorizationCodeParametersBuilder(); } + /** + * Builder for {@link AuthorizationCodeParameters} + * @param authorizationCode code received from the service authorization endpoint + * @param redirectUri URI where authorization code was received + * @return builder object that can be used to construct {@link AuthorizationCodeParameters} + */ public static AuthorizationCodeParametersBuilder builder(String authorizationCode, URI redirectUri) { validateNotBlank("authorizationCode", authorizationCode); diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java b/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java index d13f5707..dcf640e5 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java @@ -129,6 +129,44 @@ CompletableFuture executeRequest( return future; } + @Override + public CompletableFuture acquireTokenSilently(SilentParameters parameters) + throws MalformedURLException { + + validateNotNull("parameters", parameters); + + SilentRequest silentRequest = new SilentRequest( + parameters, + this, + createRequestContext(PublicApi.ACQUIRE_TOKEN_SILENTLY)); + + return executeRequest(silentRequest); + } + + @Override + public CompletableFuture> getAccounts() { + MsalRequest msalRequest = + new MsalRequest(this, null, + createRequestContext(PublicApi.GET_ACCOUNTS)){}; + + AccountsSupplier supplier = new AccountsSupplier(this, msalRequest); + + CompletableFuture> future = + serviceBundle.getExecutorService() != null ? CompletableFuture.supplyAsync(supplier, serviceBundle.getExecutorService()) + : CompletableFuture.supplyAsync(supplier); + return future; + } + + @Override + public CompletableFuture removeAccount(IAccount account) { + RemoveAccountRunnable runnable = new RemoveAccountRunnable(this, account); + + CompletableFuture future = + serviceBundle.getExecutorService() != null ? CompletableFuture.runAsync(runnable, serviceBundle.getExecutorService()) + : CompletableFuture.runAsync(runnable); + return future; + } + AuthenticationResult acquireTokenCommon(MsalRequest msalRequest, Authority requestAuthority) throws Exception { @@ -186,44 +224,6 @@ ServiceBundle getServiceBundle() { return serviceBundle; } - @Override - public CompletableFuture acquireTokenSilently(SilentParameters parameters) - throws MalformedURLException { - - validateNotNull("parameters", parameters); - - SilentRequest silentRequest = new SilentRequest( - parameters, - this, - createRequestContext(PublicApi.ACQUIRE_TOKEN_SILENTLY)); - - return executeRequest(silentRequest); - } - - @Override - public CompletableFuture> getAccounts() { - MsalRequest msalRequest = - new MsalRequest(this, null, - createRequestContext(PublicApi.GET_ACCOUNTS)){}; - - AccountsSupplier supplier = new AccountsSupplier(this, msalRequest); - - CompletableFuture> future = - serviceBundle.getExecutorService() != null ? CompletableFuture.supplyAsync(supplier, serviceBundle.getExecutorService()) - : CompletableFuture.supplyAsync(supplier); - return future; - } - - @Override - public CompletableFuture removeAccount(IAccount account) { - RemoveAccountRunnable runnable = new RemoveAccountRunnable(this, account); - - CompletableFuture future = - serviceBundle.getExecutorService() != null ? CompletableFuture.runAsync(runnable, serviceBundle.getExecutorService()) - : CompletableFuture.runAsync(runnable); - return future; - } - protected static String canonicalizeUrl(String authority) { authority = authority.toLowerCase(); @@ -272,7 +272,6 @@ public Builder(String clientId) { * @return instance of the Builder on which method was called * @throws MalformedURLException if val is malformed URL */ - public T authority(String val) throws MalformedURLException { authority = canonicalizeUrl(val); diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientAssertion.java b/src/main/java/com/microsoft/aad/msal4j/ClientAssertion.java index 80a87fa8..b89417b0 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientAssertion.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientAssertion.java @@ -28,7 +28,7 @@ import lombok.Getter; import lombok.experimental.Accessors; -/*** +/** * Credential type containing an assertion of type * "urn:ietf:params:oauth:token-type:jwt". */ @@ -44,8 +44,7 @@ public final class ClientAssertion { * Constructor to create credential with a jwt token encoded as a base64 url * encoded string. * - * @param assertion - * The jwt used as credential. + * @param assertion The jwt used as credential. */ public ClientAssertion(final String assertion) { if (StringHelper.isBlank(assertion)) { diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientCredentialFactory.java b/src/main/java/com/microsoft/aad/msal4j/ClientCredentialFactory.java index 5c6d7a8d..76f0b6c0 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientCredentialFactory.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientCredentialFactory.java @@ -29,12 +29,32 @@ import java.security.cert.CertificateException; import java.security.cert.X509Certificate; +/** + * Factory for creating client credentials used in confidential client flows + */ public class ClientCredentialFactory { + /** + * + * @param secret secret of application requesting a token + * @return {@link ClientSecret} + */ public static IClientCredential create(String secret){ return new ClientSecret(secret); } + /** + * + * @param pkcs12Certificate InputStream containing PCKS12 formatted certificate + * @param password certificate password + * @return {@link IClientCredential} + * @throws CertificateException + * @throws UnrecoverableKeyException + * @throws NoSuchAlgorithmException + * @throws KeyStoreException + * @throws NoSuchProviderException + * @throws IOException + */ public static IClientCredential create (final InputStream pkcs12Certificate, final String password) throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, @@ -42,9 +62,14 @@ public static IClientCredential create(String secret){ return AsymmetricKeyCredential.create(pkcs12Certificate, password); } + /** + * + * @param key RSA private key to sign the assertion. + * @param publicCertificate x509 public certificate used for thumbprint + * @return {@link IClientCredential} + */ public static IClientCredential create - (final PrivateKey key, final X509Certificate publicCertificate) - { + (final PrivateKey key, final X509Certificate publicCertificate) { return AsymmetricKeyCredential.create(key, publicCertificate); } } diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientCredentialParameters.java b/src/main/java/com/microsoft/aad/msal4j/ClientCredentialParameters.java index 9e5d278c..c92f05bb 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientCredentialParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientCredentialParameters.java @@ -30,6 +30,10 @@ import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotEmpty; +/** + * Object containing parameters for client credential flow. Can be used as parameter to + * {@link ConfidentialClientApplication#acquireToken(ClientCredentialParameters)} + */ @Builder @Accessors(fluent = true) @Getter @@ -44,6 +48,11 @@ private static ClientCredentialParametersBuilder builder() { return new ClientCredentialParametersBuilder(); } + /** + * Builder for {@link ClientCredentialParameters} + * @param scopes scopes application is requesting access to + * @return builder that can be used to construct ClientCredentialParameters + */ public static ClientCredentialParametersBuilder builder(Set scopes) { validateNotEmpty("scopes", scopes); diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientSecret.java b/src/main/java/com/microsoft/aad/msal4j/ClientSecret.java index 5044f5aa..8e68403f 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientSecret.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientSecret.java @@ -29,20 +29,17 @@ /** - * Credential including secret. + * Representation of client credential containing a secret in string format */ @EqualsAndHashCode public final class ClientSecret implements IClientCredential { - /** - * Gets the secret of the client requesting the token. - * - */ + @Accessors(fluent = true) @Getter private final String clientSecret; - /** + /** * Constructor to create credential with client id and secret * * @param clientSecret diff --git a/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java index ec3d62fc..174804a4 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java @@ -39,6 +39,10 @@ import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotNull; +/** + * Class to be used to acquire tokens for confidential client applications (Web Apps, Web APIs, + * and daemon applications). + */ public class ConfidentialClientApplication extends ClientApplicationBase implements IConfidentialClientApplication { @Override diff --git a/src/main/java/com/microsoft/aad/msal4j/CredentialTypeEnum.java b/src/main/java/com/microsoft/aad/msal4j/CredentialTypeEnum.java index 715812af..6ea26435 100644 --- a/src/main/java/com/microsoft/aad/msal4j/CredentialTypeEnum.java +++ b/src/main/java/com/microsoft/aad/msal4j/CredentialTypeEnum.java @@ -31,7 +31,7 @@ @Accessors(fluent = true) @Getter @AllArgsConstructor -public enum CredentialTypeEnum { +enum CredentialTypeEnum { ACCESS_TOKEN("AccessToken"), REFRESH_TOKEN("RefreshToken"), diff --git a/src/main/java/com/microsoft/aad/msal4j/DeviceCode.java b/src/main/java/com/microsoft/aad/msal4j/DeviceCode.java index 422ef4d1..9b2ac68b 100644 --- a/src/main/java/com/microsoft/aad/msal4j/DeviceCode.java +++ b/src/main/java/com/microsoft/aad/msal4j/DeviceCode.java @@ -29,42 +29,46 @@ import lombok.Setter; import lombok.experimental.Accessors; +/** + * Response returned from the STS device code endpoint containing information necessary for + * device code flow + */ @Accessors(fluent = true) @Getter public final class DeviceCode { /** - * @return user code. + * code which user needs to provide when authenticating at he verification URI */ @SerializedName("user_code") private String userCode; /** - * @return device code. + * code which should be included in the request for the access token */ @SerializedName("device_code") private String deviceCode; /** - * @return verification uri. + * URI where user can authenticate */ @SerializedName("verification_uri") private String verificationUri; /** - * @return expiration time in seconds. + * expiration time of device code in seconds. */ @SerializedName("expires_in") private long expiresIn; /** - * @return interval + * interval at which the STS should be polled at */ @SerializedName("interval") private long interval; /** - * @return message which should be displayed to the user. + * message which should be displayed to the user. */ @SerializedName("message") private String message; diff --git a/src/main/java/com/microsoft/aad/msal4j/DeviceCodeFlowParameters.java b/src/main/java/com/microsoft/aad/msal4j/DeviceCodeFlowParameters.java index 885daf38..602fcaf5 100644 --- a/src/main/java/com/microsoft/aad/msal4j/DeviceCodeFlowParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/DeviceCodeFlowParameters.java @@ -31,6 +31,10 @@ import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotEmpty; +/** + * Object containing parameters for device code flow. Can be used as parameter to + * {@link PublicClientApplication#acquireToken(DeviceCodeFlowParameters)} + */ @Builder @Accessors(fluent = true) @Getter @@ -48,6 +52,12 @@ private static DeviceCodeFlowParametersBuilder builder() { return new DeviceCodeFlowParametersBuilder(); } + /** + * Builder for {@link DeviceCodeFlowParameters} + * @param scopes scopes application is requesting access to + * @param deviceCodeConsumer {@link Consumer} of {@link DeviceCode} + * @return builder that can be used to construct DeviceCodeFlowParameters + */ public static DeviceCodeFlowParametersBuilder builder (Set scopes, Consumer deviceCodeConsumer) { diff --git a/src/main/java/com/microsoft/aad/msal4j/IAccount.java b/src/main/java/com/microsoft/aad/msal4j/IAccount.java index eab486c0..d3cde7f2 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IAccount.java +++ b/src/main/java/com/microsoft/aad/msal4j/IAccount.java @@ -23,8 +23,11 @@ package com.microsoft.aad.msal4j; +import java.util.Set; + /** - * Representation of user account + * Interface representing a single user account. An IAccount is returned in the {@link IAuthenticationResult} + * property, and is used as parameter in {@link SilentParameters#builder(Set, IAccount)} )} */ public interface IAccount { @@ -34,12 +37,12 @@ public interface IAccount { String homeAccountId(); /** - * @return account`s environment + * @return account environment */ String environment(); /** - * @return account`s username + * @return account username */ String username(); } diff --git a/src/main/java/com/microsoft/aad/msal4j/IAuthenticationResult.java b/src/main/java/com/microsoft/aad/msal4j/IAuthenticationResult.java index 334c43be..a366b510 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IAuthenticationResult.java +++ b/src/main/java/com/microsoft/aad/msal4j/IAuthenticationResult.java @@ -24,7 +24,7 @@ package com.microsoft.aad.msal4j; /** - * Represents the results of token acquisition operation. + * Interface representing the results of token acquisition operation. */ public interface IAuthenticationResult { @@ -49,7 +49,7 @@ public interface IAuthenticationResult { String environment(); /** - * @return scopes which represents amount of access that is granted to access token + * @return granted scopes values returned by the service */ String scopes(); diff --git a/src/main/java/com/microsoft/aad/msal4j/IClientApplicationBase.java b/src/main/java/com/microsoft/aad/msal4j/IClientApplicationBase.java index 3a6045d0..c7813a03 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IClientApplicationBase.java +++ b/src/main/java/com/microsoft/aad/msal4j/IClientApplicationBase.java @@ -30,6 +30,9 @@ import java.util.concurrent.CompletableFuture; import java.util.concurrent.Future; +/** + * Interface representing an application for which tokens can be acquired. + */ public interface IClientApplicationBase { String DEFAULT_AUTHORITY = "https://login.microsoftonline.com/common/"; @@ -72,7 +75,10 @@ public interface IClientApplicationBase { */ SSLSocketFactory sslSocketFactory(); - + /** + * @return Cache holding access tokens, refresh tokens, id tokens. It is maintained and used silently + * if needed when calling {@link IClientApplicationBase#acquireTokenSilently(SilentParameters)} + */ ITokenCache tokenCache(); /** @@ -80,32 +86,27 @@ public interface IClientApplicationBase { */ java.util.function.Consumer>> telemetryConsumer(); - /** * Acquires security token from the authority using an authorization code previously received. * - * @param parameters#authorizationCode The authorization code received from service authorization endpoint. - * @param parameters#redirectUri (also known as Reply URI or Reply URL), - * is the URI at which Azure AD will contact back the application with the tokens. - * This redirect URI needs to be registered in the app registration portal. + * @param parameters {@link AuthorizationCodeParameters} * @return A {@link CompletableFuture} object representing the {@link IAuthenticationResult} of the call. */ CompletableFuture acquireToken(AuthorizationCodeParameters parameters); /** - * Acquires a security token from the authority using a Refresh Token previously received. - * Can be used in migration to MSAL from ADAL v2, and in various integration - * scenarios where you have a RefreshToken available. - * See https://aka.ms/msal-net-migration-adal2-msal2. + * Acquires a security token from the authority using a refresh token previously received. + * Can be used in migration to MSAL from ADAL, and in various integration + * scenarios where you have a refresh token available. * - * @param parameters#refreshToken Refresh Token to use in the refresh flow. - * @param parameters#scopes scopes of the access request + * @param parameters {@link RefreshTokenParameters} * @return A {@link CompletableFuture} object representing the {@link IAuthenticationResult} of the call. */ CompletableFuture acquireToken(RefreshTokenParameters parameters); /** - * Returning tokens from cache or requesting new one using previously cached refresh tokens + * Returns tokens from cache if present and not expired or acquires new tokens from the authority + * by using the refresh token present in cache. * * @param parameters instance of SilentParameters * @return A {@link CompletableFuture} object representing the {@link IAuthenticationResult} of the call. @@ -115,14 +116,16 @@ CompletableFuture acquireTokenSilently(SilentParameters p throws MalformedURLException; /** + * Returns accounts in the cache + * * @return set of unique accounts from cache which can be used for silent acquire token call */ CompletableFuture> getAccounts(); /** - * Remove account from the cache + * Removes IAccount from the cache * - * @param account instance of IAccount + * @param account instance of Account to be removed from cache * * @return {@link CompletableFuture} object representing account removal task. */ diff --git a/src/main/java/com/microsoft/aad/msal4j/IClientCredential.java b/src/main/java/com/microsoft/aad/msal4j/IClientCredential.java index c9f3f0ef..f7fe9a1d 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IClientCredential.java +++ b/src/main/java/com/microsoft/aad/msal4j/IClientCredential.java @@ -23,6 +23,9 @@ package com.microsoft.aad.msal4j; +/** + * Interface representing an application credential + */ public interface IClientCredential { } diff --git a/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java index 07e43bc9..0dcff347 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java @@ -25,30 +25,28 @@ import java.util.concurrent.CompletableFuture; +/** + * Interface representing a confidential client application (Web App, Web API, Daemon App). + * Confidential client applications are trusted to safely store application secrets, and therefore + * can be used to acquire tokens in then name of either the application or an user + */ public interface IConfidentialClientApplication extends IClientApplicationBase { /** - * Acquires security token from the authority. - * - * @param parameters#scopes scopes of the access request - * @return A {@link CompletableFuture} object representing the - * {@link IAuthenticationResult} of the call. It contains Access - * Token and the Access Token's expiration time. Refresh Token - * property will be null for this overload. + * Acquires tokens from the authority configured in the application, for the confidential client + * itself (in the name of no user) + * @param parameters instance of {@link ClientCredentialParameters} + * @return {@link CompletableFuture} containing an {@link IAuthenticationResult} */ CompletableFuture acquireToken(ClientCredentialParameters parameters); /** - * Acquires an access token from the authority on behalf of a user. It - * requires using a user token previously received. - * - * @param parameters#scopes scopes of the access request - * @param parameters#userAssertion userAssertion to use as Authorization grant - * @return A {@link CompletableFuture} object representing the - * {@link IAuthenticationResult} of the call. It contains Access - * Token and the Access Token's expiration time. Refresh Token - * property will be null for this overload. - * @throws AuthenticationException {@link AuthenticationException} + * Acquires an access token for this application (usually a Web API) from the authority configured + * in the application, in order to access another downstream protected Web API on behalf of a user + * using the On-Behalf-Of flow. This confidential client application was itself called with a token + * which will be provided in the {@link UserAssertion} to the {@link OnBehalfOfParameters} + * @param parameters instance of {@link OnBehalfOfParameters} + * @return {@link CompletableFuture} containing an {@link IAuthenticationResult} */ CompletableFuture acquireToken(OnBehalfOfParameters parameters); } diff --git a/src/main/java/com/microsoft/aad/msal4j/IPublicClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/IPublicClientApplication.java index 5c534c24..3b88d9ee 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IPublicClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/IPublicClientApplication.java @@ -25,29 +25,24 @@ import java.util.concurrent.CompletableFuture; +/** + * Interface representing a public client application (Desktop, Mobile). + * Public client application are not trusted to safely store application secrets, + * and therefore can only request tokens in the name of an user + */ public interface IPublicClientApplication extends IClientApplicationBase { /** - * Acquires a security token using a username/password flow. - * - * @param parameters#scopes scopes of the access request - * @param parameters#username Username of the managed or federated user. - * @param parameters#password Password of the managed or federated user. - * If null, integrated authentication will be used. - * @return A {@link CompletableFuture} object representing the - * {@link IAuthenticationResult} of the call. It contains Access - * Token, Refresh Token and the Access Token's expiration time. + * Acquires tokens from the authority configured in the application via Username/Password authentication. + * @param parameters instance of {@link UserNamePasswordParameters} + * @return {@link CompletableFuture} containing an {@link IAuthenticationResult} */ CompletableFuture acquireToken(UserNamePasswordParameters parameters); /** - * Acquires a security token using Windows integrated authentication flow. - * - * @param parameters#scopes scopes of the access request - * @param parameters#username Username of the managed or federated user. - * @return A {@link CompletableFuture} object representing the - * {@link IAuthenticationResult} of the call. It contains Access - * Token, Refresh Token and the Access Token's expiration time. + * Acquires tokens from the authority configured in the application via Integrated Windows Authentication. + * @param parameters instance of {@link IntegratedWindowsAuthenticationParameters} + * @return {@link CompletableFuture} containing an {@link IAuthenticationResult} */ CompletableFuture acquireToken(IntegratedWindowsAuthenticationParameters parameters); @@ -62,10 +57,8 @@ public interface IPublicClientApplication extends IClientApplicationBase { * Since the client cannot receive incoming requests, it polls the authorization server repeatedly * until the end-user completes the approval process. * - * @param parameters#scopes scopes of the access request - * @param parameters#deviceCodeConsumer - * @return A {@link CompletableFuture} object representing the {@link IAuthenticationResult} of the call. - * It contains AccessTokenCacheEntity, Refresh Token and the Access Token's expiration time. + * @param parameters instance of {@link DeviceCodeFlowParameters} + * @return {@link CompletableFuture} containing an {@link IAuthenticationResult} * @throws AuthenticationException thrown if authorization is pending or another error occurred. * If the errorCode of the exception is AuthenticationErrorCode.AUTHORIZATION_PENDING, * the call needs to be retried until the AccessToken is returned. diff --git a/src/main/java/com/microsoft/aad/msal4j/ITokenCache.java b/src/main/java/com/microsoft/aad/msal4j/ITokenCache.java index e1befdd0..234b7d77 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ITokenCache.java +++ b/src/main/java/com/microsoft/aad/msal4j/ITokenCache.java @@ -24,7 +24,7 @@ package com.microsoft.aad.msal4j; /** - * Interface to implement cache persistence + * Interface representing security token cache persistence */ public interface ITokenCache { diff --git a/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessAspect.java b/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessAspect.java index 1c4b73cc..fc4023de 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessAspect.java +++ b/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessAspect.java @@ -23,10 +23,12 @@ package com.microsoft.aad.msal4j; +/** + * Interface representing operation of executing code before and after cache access. + */ public interface ITokenCacheAccessAspect { void beforeCacheAccess(ITokenCacheAccessContext iTokenCacheAccessContext); void afterCacheAccess(ITokenCacheAccessContext iTokenCacheAccessContext); - } diff --git a/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessContext.java b/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessContext.java index a22a4750..9276a6c9 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessContext.java +++ b/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessContext.java @@ -24,7 +24,7 @@ package com.microsoft.aad.msal4j; /** - * Contains parameters used by the MSAL to access the cache_data. + * Interface representing state of token cache */ public interface ITokenCacheAccessContext { diff --git a/src/main/java/com/microsoft/aad/msal4j/IUserAssertion.java b/src/main/java/com/microsoft/aad/msal4j/IUserAssertion.java index d6f55db0..521e6fa3 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IUserAssertion.java +++ b/src/main/java/com/microsoft/aad/msal4j/IUserAssertion.java @@ -23,7 +23,11 @@ package com.microsoft.aad.msal4j; +/** + * Interface representing user credential used by downstream application in On-Behalf-Of flow + */ public interface IUserAssertion { + /** * Gets the assertion. * diff --git a/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthenticationParameters.java b/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthenticationParameters.java index 4e47ca9d..188f74c6 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthenticationParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthenticationParameters.java @@ -31,6 +31,10 @@ import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotBlank; import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotEmpty; +/** + * Object containing parameters for Integrated Windows Authentication. Can be used as parameter to + * {@link PublicClientApplication#acquireToken(IntegratedWindowsAuthenticationParameters)} + */ @Builder @Accessors(fluent = true) @Getter @@ -48,6 +52,13 @@ private static IntegratedWindowsAuthenticationParametersBuilder builder() { return new IntegratedWindowsAuthenticationParametersBuilder(); } + /** + * Builder for {@link IntegratedWindowsAuthenticationParameters} + * @param scopes scopes application is requesting access to + * @param username identifier of user account for which to acquire token for. Usually in UPN format, + * e.g. john.doe@contoso.com. + * @return builder that can be used to construct IntegratedWindowsAuthenticationParameters + */ public static IntegratedWindowsAuthenticationParametersBuilder builder(Set scopes, String username) { validateNotEmpty("scopes", scopes); diff --git a/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfParameters.java b/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfParameters.java index 5648cd8d..6eb4d3f2 100644 --- a/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfParameters.java @@ -30,6 +30,10 @@ import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotEmpty; +/** + * Object containing parameters for On-Behalf-Of flow. Can be used as parameter to + * {@link ConfidentialClientApplication#acquireToken(OnBehalfOfParameters)} + */ @Builder @Accessors(fluent = true) @Getter @@ -47,6 +51,12 @@ private static OnBehalfOfParametersBuilder builder() { return new OnBehalfOfParametersBuilder(); } + /** + * Builder for {@link OnBehalfOfParameters} + * @param scopes scopes application is requesting access to + * @param userAssertion {@link UserAssertion} created from access token received + * @return builder that can be used to construct OnBehalfOfParameters + */ public static OnBehalfOfParametersBuilder builder(Set scopes, UserAssertion userAssertion) { validateNotEmpty("scopes", scopes); diff --git a/src/main/java/com/microsoft/aad/msal4j/PublicClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/PublicClientApplication.java index 1d48bc42..146711fd 100644 --- a/src/main/java/com/microsoft/aad/msal4j/PublicClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/PublicClientApplication.java @@ -33,7 +33,11 @@ import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotBlank; import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotNull; +/** + * Class to be used to acquire tokens for public client applications (Desktop, Mobile). + */ public class PublicClientApplication extends ClientApplicationBase implements IPublicClientApplication { + @Override public CompletableFuture acquireToken(UserNamePasswordParameters parameters) { @@ -112,6 +116,7 @@ public static Builder builder(String clientId) { } public static class Builder extends ClientApplicationBase.Builder { + /** * Constructor to create instance of Builder of PublicClientApplication * diff --git a/src/main/java/com/microsoft/aad/msal4j/RefreshTokenParameters.java b/src/main/java/com/microsoft/aad/msal4j/RefreshTokenParameters.java index 11895ed6..c8ad55c9 100644 --- a/src/main/java/com/microsoft/aad/msal4j/RefreshTokenParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/RefreshTokenParameters.java @@ -31,6 +31,11 @@ import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotBlank; import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotEmpty; +/** + * Object containing parameters for refresh token request. Can be used as parameter to + * {@link PublicClientApplication#acquireToken(RefreshTokenParameters)} or to + * {@link ConfidentialClientApplication#acquireToken(RefreshTokenParameters)} + */ @Builder @Accessors(fluent = true) @Getter @@ -48,6 +53,12 @@ private static RefreshTokenParametersBuilder builder() { return new RefreshTokenParametersBuilder(); } + /** + * Builder for {@link RefreshTokenParameters} + * @param scopes scopes application is requesting access to + * @param refreshToken refresh token received form the STS + * @return builder object that can be used to construct {@link RefreshTokenParameters} + */ public static RefreshTokenParametersBuilder builder(Set scopes, String refreshToken) { validateNotBlank("refreshToken", refreshToken); diff --git a/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java b/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java index 8289e9a4..7b6eec9c 100644 --- a/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java @@ -30,6 +30,11 @@ import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotEmpty; +/** + * Object containing parameters for silent requests. Can be used as parameter to + * {@link PublicClientApplication#acquireTokenSilently(SilentParameters)} or to + * {@link ConfidentialClientApplication#acquireTokenSilently(SilentParameters)} + */ @Builder @Accessors(fluent = true) @Getter @@ -51,6 +56,12 @@ private static SilentParametersBuilder builder() { return new SilentParametersBuilder(); } + /** + * Builder for SilentParameters + * @param scopes scopes application is requesting access to + * @param account {@link IAccount} for which to acquire a token for + * @return builder object that can be used to construct SilentParameters + */ public static SilentParametersBuilder builder(Set scopes, IAccount account) { validateNotEmpty("scopes", scopes); diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenCache.java b/src/main/java/com/microsoft/aad/msal4j/TokenCache.java index 3aaf8914..885a9dd5 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenCache.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenCache.java @@ -31,10 +31,17 @@ import java.util.function.Predicate; import java.util.stream.Collectors; +/** + * Cache used for storing tokens. + */ public class TokenCache implements ITokenCache { protected static final int MIN_ACCESS_TOKEN_EXPIRE_IN_SEC = 5*60; + /** + * Constructor for token cache + * @param tokenCacheAccessAspect {@link ITokenCacheAccessAspect} + */ public TokenCache(ITokenCacheAccessAspect tokenCacheAccessAspect) { this(); this.tokenCacheAccessAspect = tokenCacheAccessAspect; diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenCacheAccessContext.java b/src/main/java/com/microsoft/aad/msal4j/TokenCacheAccessContext.java index 85f2b420..5da4fe1e 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenCacheAccessContext.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenCacheAccessContext.java @@ -27,6 +27,9 @@ import lombok.Getter; import lombok.experimental.Accessors; +/** + * State of token cache + */ @Builder @Accessors(fluent = true) @Getter diff --git a/src/main/java/com/microsoft/aad/msal4j/UserAssertion.java b/src/main/java/com/microsoft/aad/msal4j/UserAssertion.java index 24423764..bb4c5ab4 100644 --- a/src/main/java/com/microsoft/aad/msal4j/UserAssertion.java +++ b/src/main/java/com/microsoft/aad/msal4j/UserAssertion.java @@ -24,7 +24,8 @@ package com.microsoft.aad.msal4j; /*** - * Credential type containing an assertion representing user credential. + * Credential type containing an assertion representing user credential. Used as a parameter in + * {@link OnBehalfOfParameters} */ public class UserAssertion implements IUserAssertion { @@ -48,7 +49,7 @@ public UserAssertion(final String assertion) { /** * Gets the assertion. * - * @return string value + * @return assertion */ @Override public String getAssertion() { diff --git a/src/main/java/com/microsoft/aad/msal4j/UserNamePasswordParameters.java b/src/main/java/com/microsoft/aad/msal4j/UserNamePasswordParameters.java index fbf5f94e..21e56967 100644 --- a/src/main/java/com/microsoft/aad/msal4j/UserNamePasswordParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/UserNamePasswordParameters.java @@ -31,6 +31,10 @@ import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotBlank; import static com.microsoft.aad.msal4j.ParameterValidationUtils.validateNotEmpty; +/** + * Object containing parameters for Username/Password flow. Can be used as parameter to + * {@link PublicClientApplication#acquireToken(UserNamePasswordParameters)} + */ @Builder @Accessors(fluent = true) @Getter @@ -55,6 +59,13 @@ private static UserNamePasswordParametersBuilder builder() { return new UserNamePasswordParametersBuilder(); } + /** + * Builder for UserNameParameters + * @param scopes scopes application is requesting access to + * @param username username of the account + * @param password char array containing credentials for the username + * @return builder object that can be used to construct UserNameParameters + */ public static UserNamePasswordParametersBuilder builder (Set scopes, String username, char[] password) { From 84d4e164660d760b5a9308fb45235078fec7c5e5 Mon Sep 17 00:00:00 2001 From: sgonzalezMSFT Date: Mon, 1 Jul 2019 11:29:35 -0700 Subject: [PATCH 10/16] PR feedback. Update license headers --- .../AcquireTokenSilentIT.java | 24 ++------------- .../AuthorizationCodeIT.java | 24 ++------------- .../CachePersistenceIT.java | 24 ++------------- .../ClientCredentialsIT.java | 24 ++------------- .../DeviceCodeIT.java | 24 ++------------- .../NationalCloudIT.java | 24 ++------------- .../OnBehalfOfIT.java | 3 ++ .../RefreshTokenIT.java | 25 ++-------------- .../TestConstants.java | 24 ++------------- .../TokenCacheIT.java | 24 ++------------- .../UsernamePasswordIT.java | 24 ++------------- .../infrastructure/SeleniumConstants.java | 24 ++------------- .../infrastructure/SeleniumExtensions.java | 24 ++------------- .../java/infrastructure/TcpListener.java | 24 ++------------- .../infrastructure/UserInformationFields.java | 24 ++------------- .../java/labapi/AppIdentityProvider.java | 24 ++------------- .../java/labapi/B2CIdentityProvider.java | 24 ++------------- .../java/labapi/FederationProvider.java | 24 ++------------- .../java/labapi/HttpClientHelper.java | 24 ++------------- .../java/labapi/KeyVaultSecretsProvider.java | 24 ++------------- .../java/labapi/LabConstants.java | 24 ++------------- .../java/labapi/LabResponse.java | 24 ++------------- .../java/labapi/LabService.java | 24 ++------------- src/integrationtest/java/labapi/LabUser.java | 24 ++------------- .../java/labapi/LabUserNotFoundException.java | 24 ++------------- .../java/labapi/LabUserProvider.java | 24 ++------------- .../java/labapi/NationalCloud.java | 24 ++------------- .../java/labapi/UserQuery.java | 24 ++------------- src/integrationtest/java/labapi/UserType.java | 24 ++------------- .../microsoft/aad/msal4j/AADAuthority.java | 24 ++------------- .../microsoft/aad/msal4j/ADFSAuthority.java | 24 ++------------- .../aad/msal4j/AadInstanceDiscovery.java | 24 ++------------- .../AbstractMsalAuthorizationGrant.java | 24 ++------------- .../aad/msal4j/AccessTokenCacheEntity.java | 24 ++------------- .../com/microsoft/aad/msal4j/Account.java | 24 ++------------- .../aad/msal4j/AccountCacheEntity.java | 24 ++------------- .../aad/msal4j/AccountsSupplier.java | 24 ++------------- ...uireTokenByAuthorizationGrantSupplier.java | 24 ++------------- .../AcquireTokenByDeviceCodeFlowSupplier.java | 24 ++------------- .../msal4j/AcquireTokenSilentSupplier.java | 24 ++------------- .../com/microsoft/aad/msal4j/ApiEvent.java | 24 ++------------- .../aad/msal4j/AppMetadataCacheEntity.java | 27 ++--------------- .../aad/msal4j/AsymmetricKeyCredential.java | 24 ++------------- .../aad/msal4j/AuthenticationErrorCode.java | 24 ++------------- .../msal4j/AuthenticationErrorMessage.java | 24 ++------------- .../aad/msal4j/AuthenticationException.java | 24 ++------------- .../aad/msal4j/AuthenticationResult.java | 24 ++------------- .../msal4j/AuthenticationResultSupplier.java | 24 ++------------- .../com/microsoft/aad/msal4j/Authority.java | 24 ++------------- .../microsoft/aad/msal4j/AuthorityType.java | 24 ++------------- .../msal4j/AuthorizationCodeParameters.java | 24 ++------------- .../aad/msal4j/AuthorizationCodeRequest.java | 24 ++------------- .../microsoft/aad/msal4j/B2CAuthority.java | 24 ++------------- .../microsoft/aad/msal4j/BindingPolicy.java | 24 ++------------- .../aad/msal4j/ClaimsChallengeException.java | 24 ++------------- .../aad/msal4j/ClientApplicationBase.java | 24 ++------------- .../microsoft/aad/msal4j/ClientAssertion.java | 24 ++------------- .../aad/msal4j/ClientAuthenticationPost.java | 24 ++------------- .../aad/msal4j/ClientCredentialFactory.java | 24 ++------------- .../msal4j/ClientCredentialParameters.java | 24 ++------------- .../aad/msal4j/ClientCredentialRequest.java | 24 ++------------- .../aad/msal4j/ClientDataHttpHeaders.java | 24 ++------------- .../com/microsoft/aad/msal4j/ClientInfo.java | 24 ++------------- .../microsoft/aad/msal4j/ClientSecret.java | 24 ++------------- .../msal4j/ConfidentialClientApplication.java | 24 ++------------- .../com/microsoft/aad/msal4j/Constants.java | 24 ++------------- .../com/microsoft/aad/msal4j/Credential.java | 24 ++------------- .../aad/msal4j/CredentialTypeEnum.java | 24 ++------------- .../microsoft/aad/msal4j/DefaultEvent.java | 24 ++------------- .../com/microsoft/aad/msal4j/DeviceCode.java | 24 ++------------- .../msal4j/DeviceCodeAuthorizationGrant.java | 24 ++------------- .../aad/msal4j/DeviceCodeFlowParameters.java | 24 ++------------- .../aad/msal4j/DeviceCodeFlowRequest.java | 24 ++------------- .../java/com/microsoft/aad/msal4j/Event.java | 24 ++------------- .../com/microsoft/aad/msal4j/EventKey.java | 24 ++------------- .../com/microsoft/aad/msal4j/HttpEvent.java | 24 ++------------- .../com/microsoft/aad/msal4j/HttpHelper.java | 24 ++------------- .../com/microsoft/aad/msal4j/HttpMethod.java | 24 ++------------- .../com/microsoft/aad/msal4j/IAccount.java | 24 ++------------- .../aad/msal4j/IAuthenticationResult.java | 24 ++------------- .../aad/msal4j/IClientApplicationBase.java | 24 ++------------- .../aad/msal4j/IClientCredential.java | 24 ++------------- .../IConfidentialClientApplication.java | 27 +++-------------- .../aad/msal4j/IPublicClientApplication.java | 29 +++---------------- .../com/microsoft/aad/msal4j/ITelemetry.java | 24 ++------------- .../aad/msal4j/ITelemetryManager.java | 24 ++------------- .../com/microsoft/aad/msal4j/ITokenCache.java | 24 ++------------- .../aad/msal4j/ITokenCacheAccessAspect.java | 24 ++------------- .../aad/msal4j/ITokenCacheAccessContext.java | 24 ++------------- .../microsoft/aad/msal4j/IUserAssertion.java | 24 ++------------- .../com/microsoft/aad/msal4j/IdToken.java | 24 ++------------- .../aad/msal4j/IdTokenCacheEntity.java | 24 ++------------- .../InstanceDiscoveryMetadataEntry.java | 24 ++------------- .../aad/msal4j/InstanceDiscoveryResponse.java | 24 ++------------- ...gratedWindowsAuthenticationParameters.java | 24 ++------------- ...ntegratedWindowsAuthenticationRequest.java | 24 ++------------- .../IntegratedWindowsAuthorizationGrant.java | 24 ++------------- .../com/microsoft/aad/msal4j/JsonHelper.java | 24 ++------------- .../com/microsoft/aad/msal4j/JwtHelper.java | 24 ++------------- .../com/microsoft/aad/msal4j/LogHelper.java | 24 ++------------- .../com/microsoft/aad/msal4j/MexParser.java | 24 ++------------- .../com/microsoft/aad/msal4j/MsalRequest.java | 24 ++------------- .../aad/msal4j/NamespaceContextImpl.java | 24 ++------------- .../aad/msal4j/OAuthAuthorizationGrant.java | 24 ++------------- .../aad/msal4j/OAuthHttpRequest.java | 24 ++------------- .../aad/msal4j/OnBehalfOfParameters.java | 24 ++------------- .../aad/msal4j/OnBehalfOfRequest.java | 24 ++------------- .../aad/msal4j/ParameterValidationUtils.java | 24 ++------------- .../com/microsoft/aad/msal4j/PublicApi.java | 24 ++------------- .../aad/msal4j/PublicClientApplication.java | 24 ++------------- .../aad/msal4j/RefreshTokenCacheEntity.java | 24 ++------------- .../aad/msal4j/RefreshTokenParameters.java | 24 ++------------- .../aad/msal4j/RefreshTokenRequest.java | 24 ++------------- .../aad/msal4j/RemoveAccountRunnable.java | 24 ++------------- .../microsoft/aad/msal4j/RequestContext.java | 24 ++------------- .../aad/msal4j/SAML11BearerGrant.java | 24 ++------------- .../msal4j/SafeDocumentBuilderFactory.java | 24 ++------------- .../microsoft/aad/msal4j/ServiceBundle.java | 24 ++------------- .../aad/msal4j/SilentParameters.java | 24 ++------------- .../microsoft/aad/msal4j/SilentRequest.java | 24 ++------------- .../microsoft/aad/msal4j/StringHelper.java | 24 ++------------- .../aad/msal4j/TelemetryConstants.java | 24 ++------------- .../microsoft/aad/msal4j/TelemetryHelper.java | 24 ++------------- .../aad/msal4j/TelemetryManager.java | 24 ++------------- .../com/microsoft/aad/msal4j/TokenCache.java | 24 ++------------- .../aad/msal4j/TokenCacheAccessContext.java | 24 ++------------- .../microsoft/aad/msal4j/TokenRequest.java | 24 ++------------- .../microsoft/aad/msal4j/TokenResponse.java | 24 ++------------- .../microsoft/aad/msal4j/UserAssertion.java | 24 ++------------- .../aad/msal4j/UserDiscoveryRequest.java | 24 ++------------- .../aad/msal4j/UserDiscoveryResponse.java | 24 ++------------- .../msal4j/UserNamePasswordParameters.java | 24 ++------------- .../aad/msal4j/UserNamePasswordRequest.java | 24 ++------------- .../microsoft/aad/msal4j/WSTrustRequest.java | 24 ++------------- .../microsoft/aad/msal4j/WSTrustResponse.java | 24 ++------------- .../microsoft/aad/msal4j/WSTrustVersion.java | 24 ++------------- .../aad/msal4j/XmsClientTelemetryInfo.java | 24 ++------------- .../ClientCredentialGrant.java | 24 ++------------- src/samples/public-client/B2CFlow.java | 2 ++ src/samples/public-client/DeviceCodeFlow.java | 25 ++-------------- .../IntegratedWindowsAuthFlow.java | 24 ++------------- src/samples/public-client/Telemetry.java | 24 ++------------- src/samples/public-client/TestData.java | 24 ++------------- .../public-client/UsernamePasswordFlow.java | 24 ++------------- .../aad/msal4jsample/AadController.java | 24 ++------------- .../aad/msal4jsample/AuthHelper.java | 24 ++------------- .../aad/msal4jsample/AuthParameterNames.java | 24 ++------------- .../aad/msal4jsample/BasicFilter.java | 24 ++------------- .../aad/msal4jsample/DirectoryObject.java | 24 ++------------- .../aad/msal4jsample/HttpClientHelper.java | 24 ++------------- .../aad/msal4jsample/JSONHelper.java | 24 ++------------- .../com/microsoft/aad/msal4jsample/User.java | 24 ++------------- .../aad/msal4j/AbstractMsalTests.java | 24 ++------------- .../aad/msal4j/AssertionCredentialTest.java | 24 ++------------- .../msal4j/AsymmetricKeyCredentialTest.java | 24 ++------------- .../microsoft/aad/msal4j/AuthorityTest.java | 24 ++------------- .../aad/msal4j/CacheFormatTests.java | 24 ++------------- .../aad/msal4j/ClientSecretTest.java | 24 ++------------- .../ConfidentialClientApplicationTest.java | 24 ++------------- .../aad/msal4j/DeviceCodeFlowTest.java | 24 ++------------- .../microsoft/aad/msal4j/HttpHelperTest.java | 24 ++------------- .../microsoft/aad/msal4j/MexParserTest.java | 24 ++------------- .../MsalOauthAuthorizatonGrantTest.java | 24 ++------------- .../msal4j/OAuthRequestValidationTest.java | 24 ++------------- .../aad/msal4j/OauthHttpRequestTest.java | 24 ++------------- .../msal4j/PublicClientApplicationTest.java | 24 ++------------- .../microsoft/aad/msal4j/TelemetryTests.java | 24 ++------------- .../aad/msal4j/TestConfiguration.java | 24 ++------------- .../com/microsoft/aad/msal4j/TestHelper.java | 24 ++------------- .../aad/msal4j/TokenRequestTest.java | 24 ++------------- .../aad/msal4j/TokenResponseTest.java | 24 ++------------- .../aad/msal4j/WSTrustRequestTest.java | 24 ++------------- .../aad/msal4j/WSTrustResponseTest.java | 24 ++------------- 173 files changed, 353 insertions(+), 3769 deletions(-) diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/AcquireTokenSilentIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/AcquireTokenSilentIT.java index fc00126a..ab9fec49 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/AcquireTokenSilentIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/AcquireTokenSilentIT.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/AuthorizationCodeIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/AuthorizationCodeIT.java index 72dfe7cb..deb80d9b 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/AuthorizationCodeIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/AuthorizationCodeIT.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/CachePersistenceIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/CachePersistenceIT.java index f607a201..7e5ce7a1 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/CachePersistenceIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/CachePersistenceIT.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; import org.testng.Assert; diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java index 367c2359..31a6576c 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/DeviceCodeIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/DeviceCodeIT.java index a96b64d0..fda7dc4d 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/DeviceCodeIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/DeviceCodeIT.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/NationalCloudIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/NationalCloudIT.java index 234865ad..e71dfffa 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/NationalCloudIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/NationalCloudIT.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/OnBehalfOfIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/OnBehalfOfIT.java index 10f2175f..21c2938f 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/OnBehalfOfIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/OnBehalfOfIT.java @@ -1,3 +1,6 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + package com.microsoft.aad.msal4j; import labapi.AppIdentityProvider; diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/RefreshTokenIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/RefreshTokenIT.java index e9c78c21..c45f60f0 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/RefreshTokenIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/RefreshTokenIT.java @@ -1,25 +1,6 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + package com.microsoft.aad.msal4j; import labapi.LabResponse; diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/TestConstants.java b/src/integrationtest/java/com.microsoft.aad.msal4j/TestConstants.java index 5f15c9fc..fb3e7813 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/TestConstants.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/TestConstants.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/TokenCacheIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/TokenCacheIT.java index 44ee857e..d4640b38 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/TokenCacheIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/TokenCacheIT.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/integrationtest/java/com.microsoft.aad.msal4j/UsernamePasswordIT.java b/src/integrationtest/java/com.microsoft.aad.msal4j/UsernamePasswordIT.java index 066fdbb5..1bcc37a6 100644 --- a/src/integrationtest/java/com.microsoft.aad.msal4j/UsernamePasswordIT.java +++ b/src/integrationtest/java/com.microsoft.aad.msal4j/UsernamePasswordIT.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/integrationtest/java/infrastructure/SeleniumConstants.java b/src/integrationtest/java/infrastructure/SeleniumConstants.java index 7cd10509..7b38694c 100644 --- a/src/integrationtest/java/infrastructure/SeleniumConstants.java +++ b/src/integrationtest/java/infrastructure/SeleniumConstants.java @@ -1,27 +1,7 @@ //---------------------------------------------------------------------- // -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // //------------------------------------------------------------------------------ diff --git a/src/integrationtest/java/infrastructure/SeleniumExtensions.java b/src/integrationtest/java/infrastructure/SeleniumExtensions.java index b8013704..fa80acd0 100644 --- a/src/integrationtest/java/infrastructure/SeleniumExtensions.java +++ b/src/integrationtest/java/infrastructure/SeleniumExtensions.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package infrastructure; diff --git a/src/integrationtest/java/infrastructure/TcpListener.java b/src/integrationtest/java/infrastructure/TcpListener.java index 9d1ab7a9..fba18a54 100644 --- a/src/integrationtest/java/infrastructure/TcpListener.java +++ b/src/integrationtest/java/infrastructure/TcpListener.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package infrastructure; diff --git a/src/integrationtest/java/infrastructure/UserInformationFields.java b/src/integrationtest/java/infrastructure/UserInformationFields.java index 75c359b7..a44688c1 100644 --- a/src/integrationtest/java/infrastructure/UserInformationFields.java +++ b/src/integrationtest/java/infrastructure/UserInformationFields.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package infrastructure; diff --git a/src/integrationtest/java/labapi/AppIdentityProvider.java b/src/integrationtest/java/labapi/AppIdentityProvider.java index 098683e3..af2f4bf2 100644 --- a/src/integrationtest/java/labapi/AppIdentityProvider.java +++ b/src/integrationtest/java/labapi/AppIdentityProvider.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package labapi; diff --git a/src/integrationtest/java/labapi/B2CIdentityProvider.java b/src/integrationtest/java/labapi/B2CIdentityProvider.java index ab0aa111..15bba2ef 100644 --- a/src/integrationtest/java/labapi/B2CIdentityProvider.java +++ b/src/integrationtest/java/labapi/B2CIdentityProvider.java @@ -1,27 +1,7 @@ //---------------------------------------------------------------------- // -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // //------------------------------------------------------------------------------ diff --git a/src/integrationtest/java/labapi/FederationProvider.java b/src/integrationtest/java/labapi/FederationProvider.java index 97a64f29..6422f2b7 100644 --- a/src/integrationtest/java/labapi/FederationProvider.java +++ b/src/integrationtest/java/labapi/FederationProvider.java @@ -1,27 +1,7 @@ //---------------------------------------------------------------------- // -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // //------------------------------------------------------------------------------ diff --git a/src/integrationtest/java/labapi/HttpClientHelper.java b/src/integrationtest/java/labapi/HttpClientHelper.java index 57c77b73..224ccf83 100644 --- a/src/integrationtest/java/labapi/HttpClientHelper.java +++ b/src/integrationtest/java/labapi/HttpClientHelper.java @@ -1,27 +1,7 @@ //---------------------------------------------------------------------- // -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // //------------------------------------------------------------------------------ diff --git a/src/integrationtest/java/labapi/KeyVaultSecretsProvider.java b/src/integrationtest/java/labapi/KeyVaultSecretsProvider.java index b4952e95..a046d294 100644 --- a/src/integrationtest/java/labapi/KeyVaultSecretsProvider.java +++ b/src/integrationtest/java/labapi/KeyVaultSecretsProvider.java @@ -1,27 +1,7 @@ //---------------------------------------------------------------------- // -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // //------------------------------------------------------------------------------ diff --git a/src/integrationtest/java/labapi/LabConstants.java b/src/integrationtest/java/labapi/LabConstants.java index a6bbabde..c1c8f51e 100644 --- a/src/integrationtest/java/labapi/LabConstants.java +++ b/src/integrationtest/java/labapi/LabConstants.java @@ -1,27 +1,7 @@ //---------------------------------------------------------------------- // -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // //------------------------------------------------------------------------------ diff --git a/src/integrationtest/java/labapi/LabResponse.java b/src/integrationtest/java/labapi/LabResponse.java index ecd1f146..c451f706 100644 --- a/src/integrationtest/java/labapi/LabResponse.java +++ b/src/integrationtest/java/labapi/LabResponse.java @@ -1,27 +1,7 @@ //---------------------------------------------------------------------- // -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // //------------------------------------------------------------------------------ diff --git a/src/integrationtest/java/labapi/LabService.java b/src/integrationtest/java/labapi/LabService.java index 741806ac..aae84807 100644 --- a/src/integrationtest/java/labapi/LabService.java +++ b/src/integrationtest/java/labapi/LabService.java @@ -1,27 +1,7 @@ //---------------------------------------------------------------------- // -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // //------------------------------------------------------------------------------ diff --git a/src/integrationtest/java/labapi/LabUser.java b/src/integrationtest/java/labapi/LabUser.java index 765e9b33..cc471737 100644 --- a/src/integrationtest/java/labapi/LabUser.java +++ b/src/integrationtest/java/labapi/LabUser.java @@ -1,27 +1,7 @@ //---------------------------------------------------------------------- // -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // //------------------------------------------------------------------------------ diff --git a/src/integrationtest/java/labapi/LabUserNotFoundException.java b/src/integrationtest/java/labapi/LabUserNotFoundException.java index 489ebd84..64a56189 100644 --- a/src/integrationtest/java/labapi/LabUserNotFoundException.java +++ b/src/integrationtest/java/labapi/LabUserNotFoundException.java @@ -1,27 +1,7 @@ //---------------------------------------------------------------------- // -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // //------------------------------------------------------------------------------ diff --git a/src/integrationtest/java/labapi/LabUserProvider.java b/src/integrationtest/java/labapi/LabUserProvider.java index 873edc74..5a7db223 100644 --- a/src/integrationtest/java/labapi/LabUserProvider.java +++ b/src/integrationtest/java/labapi/LabUserProvider.java @@ -1,27 +1,7 @@ //---------------------------------------------------------------------- // -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // //------------------------------------------------------------------------------ diff --git a/src/integrationtest/java/labapi/NationalCloud.java b/src/integrationtest/java/labapi/NationalCloud.java index 48cf077b..6fc3efab 100644 --- a/src/integrationtest/java/labapi/NationalCloud.java +++ b/src/integrationtest/java/labapi/NationalCloud.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package labapi; diff --git a/src/integrationtest/java/labapi/UserQuery.java b/src/integrationtest/java/labapi/UserQuery.java index 5c16e0db..d5b2320e 100644 --- a/src/integrationtest/java/labapi/UserQuery.java +++ b/src/integrationtest/java/labapi/UserQuery.java @@ -1,27 +1,7 @@ //---------------------------------------------------------------------- // -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // //------------------------------------------------------------------------------ diff --git a/src/integrationtest/java/labapi/UserType.java b/src/integrationtest/java/labapi/UserType.java index c9adf5b1..90b11078 100644 --- a/src/integrationtest/java/labapi/UserType.java +++ b/src/integrationtest/java/labapi/UserType.java @@ -1,27 +1,7 @@ //---------------------------------------------------------------------- // -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. // //------------------------------------------------------------------------------ diff --git a/src/main/java/com/microsoft/aad/msal4j/AADAuthority.java b/src/main/java/com/microsoft/aad/msal4j/AADAuthority.java index 5935d7d8..6ef2ca7e 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AADAuthority.java +++ b/src/main/java/com/microsoft/aad/msal4j/AADAuthority.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ADFSAuthority.java b/src/main/java/com/microsoft/aad/msal4j/ADFSAuthority.java index 59baa974..8a0c3a89 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ADFSAuthority.java +++ b/src/main/java/com/microsoft/aad/msal4j/ADFSAuthority.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AadInstanceDiscovery.java b/src/main/java/com/microsoft/aad/msal4j/AadInstanceDiscovery.java index 8313e747..68b96bdf 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AadInstanceDiscovery.java +++ b/src/main/java/com/microsoft/aad/msal4j/AadInstanceDiscovery.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AbstractMsalAuthorizationGrant.java b/src/main/java/com/microsoft/aad/msal4j/AbstractMsalAuthorizationGrant.java index 5019e8c2..130b41e8 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AbstractMsalAuthorizationGrant.java +++ b/src/main/java/com/microsoft/aad/msal4j/AbstractMsalAuthorizationGrant.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AccessTokenCacheEntity.java b/src/main/java/com/microsoft/aad/msal4j/AccessTokenCacheEntity.java index 09379bb3..17062226 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AccessTokenCacheEntity.java +++ b/src/main/java/com/microsoft/aad/msal4j/AccessTokenCacheEntity.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/Account.java b/src/main/java/com/microsoft/aad/msal4j/Account.java index 015d478e..9b2ee1b5 100644 --- a/src/main/java/com/microsoft/aad/msal4j/Account.java +++ b/src/main/java/com/microsoft/aad/msal4j/Account.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AccountCacheEntity.java b/src/main/java/com/microsoft/aad/msal4j/AccountCacheEntity.java index d870188b..f209d48a 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AccountCacheEntity.java +++ b/src/main/java/com/microsoft/aad/msal4j/AccountCacheEntity.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AccountsSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AccountsSupplier.java index 78c0d7e5..dcc58f4a 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AccountsSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AccountsSupplier.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByAuthorizationGrantSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByAuthorizationGrantSupplier.java index 6185e9b2..bf7b0945 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByAuthorizationGrantSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByAuthorizationGrantSupplier.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java index d7df92fe..d5139248 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenSilentSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenSilentSupplier.java index b5e6c87c..ba45a2dd 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenSilentSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenSilentSupplier.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ApiEvent.java b/src/main/java/com/microsoft/aad/msal4j/ApiEvent.java index c193875e..ba9864e7 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ApiEvent.java +++ b/src/main/java/com/microsoft/aad/msal4j/ApiEvent.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AppMetadataCacheEntity.java b/src/main/java/com/microsoft/aad/msal4j/AppMetadataCacheEntity.java index 9fd7fb4b..6cb2fc5b 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AppMetadataCacheEntity.java +++ b/src/main/java/com/microsoft/aad/msal4j/AppMetadataCacheEntity.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; @@ -31,9 +11,6 @@ import java.util.ArrayList; import java.util.List; -/** - * Representation of application metadata. - */ @Accessors(fluent = true) @Getter @Setter diff --git a/src/main/java/com/microsoft/aad/msal4j/AsymmetricKeyCredential.java b/src/main/java/com/microsoft/aad/msal4j/AsymmetricKeyCredential.java index 23952fb6..cca7a9f0 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AsymmetricKeyCredential.java +++ b/src/main/java/com/microsoft/aad/msal4j/AsymmetricKeyCredential.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java index aadd100f..8c2bf5fa 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorMessage.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorMessage.java index a47aa657..6c064c7d 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorMessage.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorMessage.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java index d9e5c7d8..1fe37850 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationResult.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationResult.java index 5e96eae3..30381276 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationResult.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationResult.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java index a5136707..3f7e4422 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/Authority.java b/src/main/java/com/microsoft/aad/msal4j/Authority.java index 10b84a51..f1cdf2b2 100644 --- a/src/main/java/com/microsoft/aad/msal4j/Authority.java +++ b/src/main/java/com/microsoft/aad/msal4j/Authority.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthorityType.java b/src/main/java/com/microsoft/aad/msal4j/AuthorityType.java index 7c10eb9d..aa442d74 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthorityType.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthorityType.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthorizationCodeParameters.java b/src/main/java/com/microsoft/aad/msal4j/AuthorizationCodeParameters.java index f3ca7112..f8ecdeca 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthorizationCodeParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthorizationCodeParameters.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthorizationCodeRequest.java b/src/main/java/com/microsoft/aad/msal4j/AuthorizationCodeRequest.java index 5f748de0..96ea38c2 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthorizationCodeRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthorizationCodeRequest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/B2CAuthority.java b/src/main/java/com/microsoft/aad/msal4j/B2CAuthority.java index 6bc304aa..86e51d95 100644 --- a/src/main/java/com/microsoft/aad/msal4j/B2CAuthority.java +++ b/src/main/java/com/microsoft/aad/msal4j/B2CAuthority.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/BindingPolicy.java b/src/main/java/com/microsoft/aad/msal4j/BindingPolicy.java index 19105bc0..2ad1f82d 100644 --- a/src/main/java/com/microsoft/aad/msal4j/BindingPolicy.java +++ b/src/main/java/com/microsoft/aad/msal4j/BindingPolicy.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ClaimsChallengeException.java b/src/main/java/com/microsoft/aad/msal4j/ClaimsChallengeException.java index 6ee4dff7..b978963a 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClaimsChallengeException.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClaimsChallengeException.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java b/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java index dcf640e5..18e71add 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientAssertion.java b/src/main/java/com/microsoft/aad/msal4j/ClientAssertion.java index b89417b0..689fed2d 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientAssertion.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientAssertion.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientAuthenticationPost.java b/src/main/java/com/microsoft/aad/msal4j/ClientAuthenticationPost.java index 5195e757..f511990b 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientAuthenticationPost.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientAuthenticationPost.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientCredentialFactory.java b/src/main/java/com/microsoft/aad/msal4j/ClientCredentialFactory.java index 76f0b6c0..78560619 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientCredentialFactory.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientCredentialFactory.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientCredentialParameters.java b/src/main/java/com/microsoft/aad/msal4j/ClientCredentialParameters.java index c92f05bb..8c3094f3 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientCredentialParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientCredentialParameters.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientCredentialRequest.java b/src/main/java/com/microsoft/aad/msal4j/ClientCredentialRequest.java index 9b76c8e0..f62b5c35 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientCredentialRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientCredentialRequest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientDataHttpHeaders.java b/src/main/java/com/microsoft/aad/msal4j/ClientDataHttpHeaders.java index 8b77c50f..27a16513 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientDataHttpHeaders.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientDataHttpHeaders.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientInfo.java b/src/main/java/com/microsoft/aad/msal4j/ClientInfo.java index 29524ccd..098b54bd 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientInfo.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientInfo.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientSecret.java b/src/main/java/com/microsoft/aad/msal4j/ClientSecret.java index 8e68403f..b0a4ec23 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientSecret.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientSecret.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java index 174804a4..81bf45f0 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/Constants.java b/src/main/java/com/microsoft/aad/msal4j/Constants.java index 0ee9b766..09efe264 100644 --- a/src/main/java/com/microsoft/aad/msal4j/Constants.java +++ b/src/main/java/com/microsoft/aad/msal4j/Constants.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/Credential.java b/src/main/java/com/microsoft/aad/msal4j/Credential.java index 817f377b..ca2370f9 100644 --- a/src/main/java/com/microsoft/aad/msal4j/Credential.java +++ b/src/main/java/com/microsoft/aad/msal4j/Credential.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/CredentialTypeEnum.java b/src/main/java/com/microsoft/aad/msal4j/CredentialTypeEnum.java index 6ea26435..325a799e 100644 --- a/src/main/java/com/microsoft/aad/msal4j/CredentialTypeEnum.java +++ b/src/main/java/com/microsoft/aad/msal4j/CredentialTypeEnum.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/DefaultEvent.java b/src/main/java/com/microsoft/aad/msal4j/DefaultEvent.java index 91de5ea4..075b9e33 100644 --- a/src/main/java/com/microsoft/aad/msal4j/DefaultEvent.java +++ b/src/main/java/com/microsoft/aad/msal4j/DefaultEvent.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/DeviceCode.java b/src/main/java/com/microsoft/aad/msal4j/DeviceCode.java index 9b2ac68b..c001e2cd 100644 --- a/src/main/java/com/microsoft/aad/msal4j/DeviceCode.java +++ b/src/main/java/com/microsoft/aad/msal4j/DeviceCode.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/DeviceCodeAuthorizationGrant.java b/src/main/java/com/microsoft/aad/msal4j/DeviceCodeAuthorizationGrant.java index 20621c75..4528efab 100644 --- a/src/main/java/com/microsoft/aad/msal4j/DeviceCodeAuthorizationGrant.java +++ b/src/main/java/com/microsoft/aad/msal4j/DeviceCodeAuthorizationGrant.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/DeviceCodeFlowParameters.java b/src/main/java/com/microsoft/aad/msal4j/DeviceCodeFlowParameters.java index 602fcaf5..f27d0863 100644 --- a/src/main/java/com/microsoft/aad/msal4j/DeviceCodeFlowParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/DeviceCodeFlowParameters.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/DeviceCodeFlowRequest.java b/src/main/java/com/microsoft/aad/msal4j/DeviceCodeFlowRequest.java index a37b87d9..e8ed7d28 100644 --- a/src/main/java/com/microsoft/aad/msal4j/DeviceCodeFlowRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/DeviceCodeFlowRequest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/Event.java b/src/main/java/com/microsoft/aad/msal4j/Event.java index fab4d68c..6baf2598 100644 --- a/src/main/java/com/microsoft/aad/msal4j/Event.java +++ b/src/main/java/com/microsoft/aad/msal4j/Event.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/EventKey.java b/src/main/java/com/microsoft/aad/msal4j/EventKey.java index a7dc907b..5b50374a 100644 --- a/src/main/java/com/microsoft/aad/msal4j/EventKey.java +++ b/src/main/java/com/microsoft/aad/msal4j/EventKey.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/HttpEvent.java b/src/main/java/com/microsoft/aad/msal4j/HttpEvent.java index d537d32b..ba4b7b79 100644 --- a/src/main/java/com/microsoft/aad/msal4j/HttpEvent.java +++ b/src/main/java/com/microsoft/aad/msal4j/HttpEvent.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/HttpHelper.java b/src/main/java/com/microsoft/aad/msal4j/HttpHelper.java index 5181cc21..656a46b3 100644 --- a/src/main/java/com/microsoft/aad/msal4j/HttpHelper.java +++ b/src/main/java/com/microsoft/aad/msal4j/HttpHelper.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/HttpMethod.java b/src/main/java/com/microsoft/aad/msal4j/HttpMethod.java index 67905d69..6f9f1b1a 100644 --- a/src/main/java/com/microsoft/aad/msal4j/HttpMethod.java +++ b/src/main/java/com/microsoft/aad/msal4j/HttpMethod.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/IAccount.java b/src/main/java/com/microsoft/aad/msal4j/IAccount.java index d3cde7f2..9814d944 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IAccount.java +++ b/src/main/java/com/microsoft/aad/msal4j/IAccount.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/IAuthenticationResult.java b/src/main/java/com/microsoft/aad/msal4j/IAuthenticationResult.java index a366b510..abaf78ec 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IAuthenticationResult.java +++ b/src/main/java/com/microsoft/aad/msal4j/IAuthenticationResult.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/IClientApplicationBase.java b/src/main/java/com/microsoft/aad/msal4j/IClientApplicationBase.java index c7813a03..be157c80 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IClientApplicationBase.java +++ b/src/main/java/com/microsoft/aad/msal4j/IClientApplicationBase.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/IClientCredential.java b/src/main/java/com/microsoft/aad/msal4j/IClientCredential.java index f7fe9a1d..09053adf 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IClientCredential.java +++ b/src/main/java/com/microsoft/aad/msal4j/IClientCredential.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java index 0dcff347..79d8d42d 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; @@ -28,7 +8,8 @@ /** * Interface representing a confidential client application (Web App, Web API, Daemon App). * Confidential client applications are trusted to safely store application secrets, and therefore - * can be used to acquire tokens in then name of either the application or an user + * can be used to acquire tokens in then name of either the application or an user. + * For details see https://aka.ms/msal4jclientapplications */ public interface IConfidentialClientApplication extends IClientApplicationBase { diff --git a/src/main/java/com/microsoft/aad/msal4j/IPublicClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/IPublicClientApplication.java index 3b88d9ee..5a981583 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IPublicClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/IPublicClientApplication.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; @@ -28,7 +8,8 @@ /** * Interface representing a public client application (Desktop, Mobile). * Public client application are not trusted to safely store application secrets, - * and therefore can only request tokens in the name of an user + * and therefore can only request tokens in the name of an user. + * For details see https://aka.ms/msal4jclientapplications */ public interface IPublicClientApplication extends IClientApplicationBase { @@ -48,12 +29,10 @@ public interface IPublicClientApplication extends IClientApplicationBase { /** * Acquires security token from the authority using an device code flow. - *

* Flow is designed for devices that do not have access to a browser or have input constraints. * The authorization server issues DeviceCode object with verification code, an end-user code * and the end-user verification URI. DeviceCode is provided through deviceCodeConsumer callback. * End-user should be instructed to use another device to connect to the authorization server to approve the access request. - *

* Since the client cannot receive incoming requests, it polls the authorization server repeatedly * until the end-user completes the approval process. * diff --git a/src/main/java/com/microsoft/aad/msal4j/ITelemetry.java b/src/main/java/com/microsoft/aad/msal4j/ITelemetry.java index 56212a67..1109a99c 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ITelemetry.java +++ b/src/main/java/com/microsoft/aad/msal4j/ITelemetry.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ITelemetryManager.java b/src/main/java/com/microsoft/aad/msal4j/ITelemetryManager.java index 4cefb74b..6996a34b 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ITelemetryManager.java +++ b/src/main/java/com/microsoft/aad/msal4j/ITelemetryManager.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ITokenCache.java b/src/main/java/com/microsoft/aad/msal4j/ITokenCache.java index 234b7d77..9329a7f9 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ITokenCache.java +++ b/src/main/java/com/microsoft/aad/msal4j/ITokenCache.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessAspect.java b/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessAspect.java index fc4023de..3659c57f 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessAspect.java +++ b/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessAspect.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessContext.java b/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessContext.java index 9276a6c9..7fc3ed39 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessContext.java +++ b/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessContext.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/IUserAssertion.java b/src/main/java/com/microsoft/aad/msal4j/IUserAssertion.java index 521e6fa3..b17891f0 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IUserAssertion.java +++ b/src/main/java/com/microsoft/aad/msal4j/IUserAssertion.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/IdToken.java b/src/main/java/com/microsoft/aad/msal4j/IdToken.java index ca965535..a8eadb46 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IdToken.java +++ b/src/main/java/com/microsoft/aad/msal4j/IdToken.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/IdTokenCacheEntity.java b/src/main/java/com/microsoft/aad/msal4j/IdTokenCacheEntity.java index d6bf2a4d..5aae730e 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IdTokenCacheEntity.java +++ b/src/main/java/com/microsoft/aad/msal4j/IdTokenCacheEntity.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/InstanceDiscoveryMetadataEntry.java b/src/main/java/com/microsoft/aad/msal4j/InstanceDiscoveryMetadataEntry.java index 762f7c55..e0f12cea 100644 --- a/src/main/java/com/microsoft/aad/msal4j/InstanceDiscoveryMetadataEntry.java +++ b/src/main/java/com/microsoft/aad/msal4j/InstanceDiscoveryMetadataEntry.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/InstanceDiscoveryResponse.java b/src/main/java/com/microsoft/aad/msal4j/InstanceDiscoveryResponse.java index 33ca670a..d48b3f0d 100644 --- a/src/main/java/com/microsoft/aad/msal4j/InstanceDiscoveryResponse.java +++ b/src/main/java/com/microsoft/aad/msal4j/InstanceDiscoveryResponse.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthenticationParameters.java b/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthenticationParameters.java index 188f74c6..df9fb12c 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthenticationParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthenticationParameters.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthenticationRequest.java b/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthenticationRequest.java index ea2e8d18..ed9f8e34 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthenticationRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthenticationRequest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthorizationGrant.java b/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthorizationGrant.java index 0a969626..a0cb9603 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthorizationGrant.java +++ b/src/main/java/com/microsoft/aad/msal4j/IntegratedWindowsAuthorizationGrant.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/JsonHelper.java b/src/main/java/com/microsoft/aad/msal4j/JsonHelper.java index 9cfbd3cc..53634c9c 100644 --- a/src/main/java/com/microsoft/aad/msal4j/JsonHelper.java +++ b/src/main/java/com/microsoft/aad/msal4j/JsonHelper.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java b/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java index 095bcd58..57d96452 100644 --- a/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java +++ b/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/LogHelper.java b/src/main/java/com/microsoft/aad/msal4j/LogHelper.java index a9f35a2b..5237cfaa 100644 --- a/src/main/java/com/microsoft/aad/msal4j/LogHelper.java +++ b/src/main/java/com/microsoft/aad/msal4j/LogHelper.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/MexParser.java b/src/main/java/com/microsoft/aad/msal4j/MexParser.java index 3c9731cb..c35ae74f 100644 --- a/src/main/java/com/microsoft/aad/msal4j/MexParser.java +++ b/src/main/java/com/microsoft/aad/msal4j/MexParser.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/MsalRequest.java b/src/main/java/com/microsoft/aad/msal4j/MsalRequest.java index 85b5dfc6..3ca12638 100644 --- a/src/main/java/com/microsoft/aad/msal4j/MsalRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/MsalRequest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/NamespaceContextImpl.java b/src/main/java/com/microsoft/aad/msal4j/NamespaceContextImpl.java index 93090f4d..32ca1085 100644 --- a/src/main/java/com/microsoft/aad/msal4j/NamespaceContextImpl.java +++ b/src/main/java/com/microsoft/aad/msal4j/NamespaceContextImpl.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/OAuthAuthorizationGrant.java b/src/main/java/com/microsoft/aad/msal4j/OAuthAuthorizationGrant.java index c29bcebd..674b3cbe 100644 --- a/src/main/java/com/microsoft/aad/msal4j/OAuthAuthorizationGrant.java +++ b/src/main/java/com/microsoft/aad/msal4j/OAuthAuthorizationGrant.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/OAuthHttpRequest.java b/src/main/java/com/microsoft/aad/msal4j/OAuthHttpRequest.java index f4e87a57..0c5aa416 100644 --- a/src/main/java/com/microsoft/aad/msal4j/OAuthHttpRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/OAuthHttpRequest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfParameters.java b/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfParameters.java index 6eb4d3f2..39b84e0d 100644 --- a/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfParameters.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfRequest.java b/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfRequest.java index a50f0dc1..57a9d784 100644 --- a/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfRequest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ParameterValidationUtils.java b/src/main/java/com/microsoft/aad/msal4j/ParameterValidationUtils.java index 284a3f56..155aea83 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ParameterValidationUtils.java +++ b/src/main/java/com/microsoft/aad/msal4j/ParameterValidationUtils.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/PublicApi.java b/src/main/java/com/microsoft/aad/msal4j/PublicApi.java index 40608d9a..13e41177 100644 --- a/src/main/java/com/microsoft/aad/msal4j/PublicApi.java +++ b/src/main/java/com/microsoft/aad/msal4j/PublicApi.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/PublicClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/PublicClientApplication.java index 146711fd..d34ae186 100644 --- a/src/main/java/com/microsoft/aad/msal4j/PublicClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/PublicClientApplication.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/RefreshTokenCacheEntity.java b/src/main/java/com/microsoft/aad/msal4j/RefreshTokenCacheEntity.java index 38d26a6b..ce619b00 100644 --- a/src/main/java/com/microsoft/aad/msal4j/RefreshTokenCacheEntity.java +++ b/src/main/java/com/microsoft/aad/msal4j/RefreshTokenCacheEntity.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -//// All rights reserved. -//// -//// This code is licensed under the MIT License. -//// -//// Permission is hereby granted, free of charge, to any person obtaining a copy -//// of this software and associated documentation files(the "Software"), to deal -//// in the Software without restriction, including without limitation the rights -//// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -//// copies of the Software, and to permit persons to whom the Software is -//// furnished to do so, subject to the following conditions : -//// -//// The above copyright notice and this permission notice shall be included in -//// all copies or substantial portions of the Software. -//// -//// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -//// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -//// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -//// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -//// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -//// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -//// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/RefreshTokenParameters.java b/src/main/java/com/microsoft/aad/msal4j/RefreshTokenParameters.java index c8ad55c9..5a7b0488 100644 --- a/src/main/java/com/microsoft/aad/msal4j/RefreshTokenParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/RefreshTokenParameters.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/RefreshTokenRequest.java b/src/main/java/com/microsoft/aad/msal4j/RefreshTokenRequest.java index 62c054bb..b9885858 100644 --- a/src/main/java/com/microsoft/aad/msal4j/RefreshTokenRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/RefreshTokenRequest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/RemoveAccountRunnable.java b/src/main/java/com/microsoft/aad/msal4j/RemoveAccountRunnable.java index 586788d8..ec4ddcb5 100644 --- a/src/main/java/com/microsoft/aad/msal4j/RemoveAccountRunnable.java +++ b/src/main/java/com/microsoft/aad/msal4j/RemoveAccountRunnable.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/RequestContext.java b/src/main/java/com/microsoft/aad/msal4j/RequestContext.java index b4f30219..d1f76b20 100644 --- a/src/main/java/com/microsoft/aad/msal4j/RequestContext.java +++ b/src/main/java/com/microsoft/aad/msal4j/RequestContext.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/SAML11BearerGrant.java b/src/main/java/com/microsoft/aad/msal4j/SAML11BearerGrant.java index fb490ccb..9ec71197 100644 --- a/src/main/java/com/microsoft/aad/msal4j/SAML11BearerGrant.java +++ b/src/main/java/com/microsoft/aad/msal4j/SAML11BearerGrant.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/SafeDocumentBuilderFactory.java b/src/main/java/com/microsoft/aad/msal4j/SafeDocumentBuilderFactory.java index 47fc4dfb..173c9331 100644 --- a/src/main/java/com/microsoft/aad/msal4j/SafeDocumentBuilderFactory.java +++ b/src/main/java/com/microsoft/aad/msal4j/SafeDocumentBuilderFactory.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/ServiceBundle.java b/src/main/java/com/microsoft/aad/msal4j/ServiceBundle.java index 78aa72d9..7570e63f 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ServiceBundle.java +++ b/src/main/java/com/microsoft/aad/msal4j/ServiceBundle.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java b/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java index 7b6eec9c..31efdfdd 100644 --- a/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/SilentRequest.java b/src/main/java/com/microsoft/aad/msal4j/SilentRequest.java index 4aeb4faf..371d0e67 100644 --- a/src/main/java/com/microsoft/aad/msal4j/SilentRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/SilentRequest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/StringHelper.java b/src/main/java/com/microsoft/aad/msal4j/StringHelper.java index 803ebd42..50d93311 100644 --- a/src/main/java/com/microsoft/aad/msal4j/StringHelper.java +++ b/src/main/java/com/microsoft/aad/msal4j/StringHelper.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/TelemetryConstants.java b/src/main/java/com/microsoft/aad/msal4j/TelemetryConstants.java index 11002b94..eb27dd47 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TelemetryConstants.java +++ b/src/main/java/com/microsoft/aad/msal4j/TelemetryConstants.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/TelemetryHelper.java b/src/main/java/com/microsoft/aad/msal4j/TelemetryHelper.java index 6e8549eb..d24ada87 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TelemetryHelper.java +++ b/src/main/java/com/microsoft/aad/msal4j/TelemetryHelper.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/TelemetryManager.java b/src/main/java/com/microsoft/aad/msal4j/TelemetryManager.java index 061cdea8..2a0493ec 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TelemetryManager.java +++ b/src/main/java/com/microsoft/aad/msal4j/TelemetryManager.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenCache.java b/src/main/java/com/microsoft/aad/msal4j/TokenCache.java index 885a9dd5..35ae209d 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenCache.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenCache.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenCacheAccessContext.java b/src/main/java/com/microsoft/aad/msal4j/TokenCacheAccessContext.java index 5da4fe1e..59f50982 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenCacheAccessContext.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenCacheAccessContext.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java b/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java index b1e95de8..6b8984d1 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenResponse.java b/src/main/java/com/microsoft/aad/msal4j/TokenResponse.java index cb071367..56533a70 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenResponse.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenResponse.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/UserAssertion.java b/src/main/java/com/microsoft/aad/msal4j/UserAssertion.java index bb4c5ab4..6cacba74 100644 --- a/src/main/java/com/microsoft/aad/msal4j/UserAssertion.java +++ b/src/main/java/com/microsoft/aad/msal4j/UserAssertion.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryRequest.java b/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryRequest.java index 525de9c3..bca3d010 100644 --- a/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryRequest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryResponse.java b/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryResponse.java index c8d9f445..26b15742 100644 --- a/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryResponse.java +++ b/src/main/java/com/microsoft/aad/msal4j/UserDiscoveryResponse.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/UserNamePasswordParameters.java b/src/main/java/com/microsoft/aad/msal4j/UserNamePasswordParameters.java index 21e56967..398194b0 100644 --- a/src/main/java/com/microsoft/aad/msal4j/UserNamePasswordParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/UserNamePasswordParameters.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/UserNamePasswordRequest.java b/src/main/java/com/microsoft/aad/msal4j/UserNamePasswordRequest.java index c82370a1..fcd37eb1 100644 --- a/src/main/java/com/microsoft/aad/msal4j/UserNamePasswordRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/UserNamePasswordRequest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/WSTrustRequest.java b/src/main/java/com/microsoft/aad/msal4j/WSTrustRequest.java index f32af122..59bd661c 100644 --- a/src/main/java/com/microsoft/aad/msal4j/WSTrustRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/WSTrustRequest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/WSTrustResponse.java b/src/main/java/com/microsoft/aad/msal4j/WSTrustResponse.java index 2d4cbed0..ec10f631 100644 --- a/src/main/java/com/microsoft/aad/msal4j/WSTrustResponse.java +++ b/src/main/java/com/microsoft/aad/msal4j/WSTrustResponse.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/WSTrustVersion.java b/src/main/java/com/microsoft/aad/msal4j/WSTrustVersion.java index 1170941e..b569af3a 100644 --- a/src/main/java/com/microsoft/aad/msal4j/WSTrustVersion.java +++ b/src/main/java/com/microsoft/aad/msal4j/WSTrustVersion.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/XmsClientTelemetryInfo.java b/src/main/java/com/microsoft/aad/msal4j/XmsClientTelemetryInfo.java index 77e42720..1a001c63 100644 --- a/src/main/java/com/microsoft/aad/msal4j/XmsClientTelemetryInfo.java +++ b/src/main/java/com/microsoft/aad/msal4j/XmsClientTelemetryInfo.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/samples/confidential-client/ClientCredentialGrant.java b/src/samples/confidential-client/ClientCredentialGrant.java index 23945b0d..61f96fe5 100644 --- a/src/samples/confidential-client/ClientCredentialGrant.java +++ b/src/samples/confidential-client/ClientCredentialGrant.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. import com.microsoft.aad.msal4j.AuthenticationResult; import com.microsoft.aad.msal4j.ClientCredentialFactory; diff --git a/src/samples/public-client/B2CFlow.java b/src/samples/public-client/B2CFlow.java index 2a596d3d..d8dae7fd 100644 --- a/src/samples/public-client/B2CFlow.java +++ b/src/samples/public-client/B2CFlow.java @@ -1,3 +1,5 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. import com.microsoft.aad.msal4j.IAuthenticationResult; import com.microsoft.aad.msal4j.PublicClientApplication; diff --git a/src/samples/public-client/DeviceCodeFlow.java b/src/samples/public-client/DeviceCodeFlow.java index 6f666ddf..e928db56 100644 --- a/src/samples/public-client/DeviceCodeFlow.java +++ b/src/samples/public-client/DeviceCodeFlow.java @@ -1,25 +1,6 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + import com.microsoft.aad.msal4j.*; import java.util.Collections; diff --git a/src/samples/public-client/IntegratedWindowsAuthFlow.java b/src/samples/public-client/IntegratedWindowsAuthFlow.java index 3a5ce623..6afcb696 100644 --- a/src/samples/public-client/IntegratedWindowsAuthFlow.java +++ b/src/samples/public-client/IntegratedWindowsAuthFlow.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. import com.microsoft.aad.msal4j.IAuthenticationResult; import com.microsoft.aad.msal4j.IntegratedWindowsAuthenticationParameters; diff --git a/src/samples/public-client/Telemetry.java b/src/samples/public-client/Telemetry.java index ef8d5961..00346a9d 100644 --- a/src/samples/public-client/Telemetry.java +++ b/src/samples/public-client/Telemetry.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. import com.microsoft.aad.msal4j.IAuthenticationResult; import com.microsoft.aad.msal4j.PublicClientApplication; diff --git a/src/samples/public-client/TestData.java b/src/samples/public-client/TestData.java index 9afb1e40..af70e5b9 100644 --- a/src/samples/public-client/TestData.java +++ b/src/samples/public-client/TestData.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. public class TestData { diff --git a/src/samples/public-client/UsernamePasswordFlow.java b/src/samples/public-client/UsernamePasswordFlow.java index 6bfc9565..ce9f47da 100644 --- a/src/samples/public-client/UsernamePasswordFlow.java +++ b/src/samples/public-client/UsernamePasswordFlow.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. import com.microsoft.aad.msal4j.*; diff --git a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/AadController.java b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/AadController.java index be0918a4..c7659905 100644 --- a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/AadController.java +++ b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/AadController.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4jsample; diff --git a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/AuthHelper.java b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/AuthHelper.java index ff8baf2f..f3eb6b9f 100644 --- a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/AuthHelper.java +++ b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/AuthHelper.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4jsample; diff --git a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/AuthParameterNames.java b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/AuthParameterNames.java index ee87b191..f4999f93 100644 --- a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/AuthParameterNames.java +++ b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/AuthParameterNames.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4jsample; diff --git a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/BasicFilter.java b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/BasicFilter.java index 86c0bcc6..d26967ea 100644 --- a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/BasicFilter.java +++ b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/BasicFilter.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4jsample; diff --git a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/DirectoryObject.java b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/DirectoryObject.java index ce30148c..6c861d78 100644 --- a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/DirectoryObject.java +++ b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/DirectoryObject.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4jsample; diff --git a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/HttpClientHelper.java b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/HttpClientHelper.java index 827e7cad..c0733e3e 100644 --- a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/HttpClientHelper.java +++ b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/HttpClientHelper.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4jsample; diff --git a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/JSONHelper.java b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/JSONHelper.java index 128200e9..456901c4 100644 --- a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/JSONHelper.java +++ b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/JSONHelper.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4jsample; diff --git a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/User.java b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/User.java index 9fa146d7..5c544641 100644 --- a/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/User.java +++ b/src/samples/web-app-samples-for-msal4j/src/main/java/com/microsoft/aad/msal4jsample/User.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4jsample; diff --git a/src/test/java/com/microsoft/aad/msal4j/AbstractMsalTests.java b/src/test/java/com/microsoft/aad/msal4j/AbstractMsalTests.java index 0b5ed056..a1c559ee 100644 --- a/src/test/java/com/microsoft/aad/msal4j/AbstractMsalTests.java +++ b/src/test/java/com/microsoft/aad/msal4j/AbstractMsalTests.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/AssertionCredentialTest.java b/src/test/java/com/microsoft/aad/msal4j/AssertionCredentialTest.java index fbe48484..31535495 100644 --- a/src/test/java/com/microsoft/aad/msal4j/AssertionCredentialTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/AssertionCredentialTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/AsymmetricKeyCredentialTest.java b/src/test/java/com/microsoft/aad/msal4j/AsymmetricKeyCredentialTest.java index 9784ce1a..a7f19bcf 100644 --- a/src/test/java/com/microsoft/aad/msal4j/AsymmetricKeyCredentialTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/AsymmetricKeyCredentialTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/AuthorityTest.java b/src/test/java/com/microsoft/aad/msal4j/AuthorityTest.java index efd9de18..13ce90ea 100644 --- a/src/test/java/com/microsoft/aad/msal4j/AuthorityTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/AuthorityTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/CacheFormatTests.java b/src/test/java/com/microsoft/aad/msal4j/CacheFormatTests.java index 6d0c6c12..73cf5e4e 100644 --- a/src/test/java/com/microsoft/aad/msal4j/CacheFormatTests.java +++ b/src/test/java/com/microsoft/aad/msal4j/CacheFormatTests.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/ClientSecretTest.java b/src/test/java/com/microsoft/aad/msal4j/ClientSecretTest.java index de5e1952..d058c8cf 100644 --- a/src/test/java/com/microsoft/aad/msal4j/ClientSecretTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/ClientSecretTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/ConfidentialClientApplicationTest.java b/src/test/java/com/microsoft/aad/msal4j/ConfidentialClientApplicationTest.java index 5cd874fd..386323c3 100644 --- a/src/test/java/com/microsoft/aad/msal4j/ConfidentialClientApplicationTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/ConfidentialClientApplicationTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java b/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java index ee738ea7..575fab0c 100644 --- a/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/HttpHelperTest.java b/src/test/java/com/microsoft/aad/msal4j/HttpHelperTest.java index 0318b3dc..fc5b7d1b 100644 --- a/src/test/java/com/microsoft/aad/msal4j/HttpHelperTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/HttpHelperTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/MexParserTest.java b/src/test/java/com/microsoft/aad/msal4j/MexParserTest.java index 782fe6a6..1a7e63c9 100644 --- a/src/test/java/com/microsoft/aad/msal4j/MexParserTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/MexParserTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/MsalOauthAuthorizatonGrantTest.java b/src/test/java/com/microsoft/aad/msal4j/MsalOauthAuthorizatonGrantTest.java index 897acce9..9df15577 100644 --- a/src/test/java/com/microsoft/aad/msal4j/MsalOauthAuthorizatonGrantTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/MsalOauthAuthorizatonGrantTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/OAuthRequestValidationTest.java b/src/test/java/com/microsoft/aad/msal4j/OAuthRequestValidationTest.java index 9fa3bb29..077a606f 100644 --- a/src/test/java/com/microsoft/aad/msal4j/OAuthRequestValidationTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/OAuthRequestValidationTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/OauthHttpRequestTest.java b/src/test/java/com/microsoft/aad/msal4j/OauthHttpRequestTest.java index 4b7a55f6..5713ad57 100644 --- a/src/test/java/com/microsoft/aad/msal4j/OauthHttpRequestTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/OauthHttpRequestTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/PublicClientApplicationTest.java b/src/test/java/com/microsoft/aad/msal4j/PublicClientApplicationTest.java index ba46b87a..0d0e2ff0 100644 --- a/src/test/java/com/microsoft/aad/msal4j/PublicClientApplicationTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/PublicClientApplicationTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/TelemetryTests.java b/src/test/java/com/microsoft/aad/msal4j/TelemetryTests.java index ea1bae80..fc821d2d 100644 --- a/src/test/java/com/microsoft/aad/msal4j/TelemetryTests.java +++ b/src/test/java/com/microsoft/aad/msal4j/TelemetryTests.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/TestConfiguration.java b/src/test/java/com/microsoft/aad/msal4j/TestConfiguration.java index d314c5c3..d56405ac 100644 --- a/src/test/java/com/microsoft/aad/msal4j/TestConfiguration.java +++ b/src/test/java/com/microsoft/aad/msal4j/TestConfiguration.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/TestHelper.java b/src/test/java/com/microsoft/aad/msal4j/TestHelper.java index d465b7a1..5a87d1a6 100644 --- a/src/test/java/com/microsoft/aad/msal4j/TestHelper.java +++ b/src/test/java/com/microsoft/aad/msal4j/TestHelper.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java b/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java index a6570e7b..c346611b 100644 --- a/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/TokenResponseTest.java b/src/test/java/com/microsoft/aad/msal4j/TokenResponseTest.java index 5052e14c..d43aaf5b 100644 --- a/src/test/java/com/microsoft/aad/msal4j/TokenResponseTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/TokenResponseTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/WSTrustRequestTest.java b/src/test/java/com/microsoft/aad/msal4j/WSTrustRequestTest.java index 7596316d..1b90e9b6 100644 --- a/src/test/java/com/microsoft/aad/msal4j/WSTrustRequestTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/WSTrustRequestTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/test/java/com/microsoft/aad/msal4j/WSTrustResponseTest.java b/src/test/java/com/microsoft/aad/msal4j/WSTrustResponseTest.java index 7e9da3bb..fcbb7ecb 100644 --- a/src/test/java/com/microsoft/aad/msal4j/WSTrustResponseTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/WSTrustResponseTest.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; From c28f0323fa108f17414917bf724e5fb48ee562d1 Mon Sep 17 00:00:00 2001 From: sgonzalezMSFT Date: Tue, 2 Jul 2019 10:26:20 -0700 Subject: [PATCH 11/16] PR feedback round 2 --- src/main/java/com/microsoft/aad/msal4j/DeviceCode.java | 2 +- .../microsoft/aad/msal4j/IConfidentialClientApplication.java | 2 +- .../com/microsoft/aad/msal4j/ITokenCacheAccessContext.java | 2 +- src/main/java/com/microsoft/aad/msal4j/IUserAssertion.java | 2 +- .../com/microsoft/aad/msal4j/TokenCacheAccessContext.java | 2 +- src/main/java/com/microsoft/aad/msal4j/UserAssertion.java | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/microsoft/aad/msal4j/DeviceCode.java b/src/main/java/com/microsoft/aad/msal4j/DeviceCode.java index c001e2cd..548f8702 100644 --- a/src/main/java/com/microsoft/aad/msal4j/DeviceCode.java +++ b/src/main/java/com/microsoft/aad/msal4j/DeviceCode.java @@ -18,7 +18,7 @@ public final class DeviceCode { /** - * code which user needs to provide when authenticating at he verification URI + * code which user needs to provide when authenticating at the verification URI */ @SerializedName("user_code") private String userCode; diff --git a/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java index 79d8d42d..e9199e7d 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java @@ -15,7 +15,7 @@ public interface IConfidentialClientApplication extends IClientApplicationBase { /** * Acquires tokens from the authority configured in the application, for the confidential client - * itself (in the name of no user) + * itself * @param parameters instance of {@link ClientCredentialParameters} * @return {@link CompletableFuture} containing an {@link IAuthenticationResult} */ diff --git a/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessContext.java b/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessContext.java index 7fc3ed39..3c386334 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessContext.java +++ b/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessContext.java @@ -4,7 +4,7 @@ package com.microsoft.aad.msal4j; /** - * Interface representing state of token cache + * Interface representing context in which the token cache is accessed */ public interface ITokenCacheAccessContext { diff --git a/src/main/java/com/microsoft/aad/msal4j/IUserAssertion.java b/src/main/java/com/microsoft/aad/msal4j/IUserAssertion.java index b17891f0..501cb3c6 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IUserAssertion.java +++ b/src/main/java/com/microsoft/aad/msal4j/IUserAssertion.java @@ -4,7 +4,7 @@ package com.microsoft.aad.msal4j; /** - * Interface representing user credential used by downstream application in On-Behalf-Of flow + * Interface representing a delegated user identity used by downstream applications in On-Behalf-Of flow */ public interface IUserAssertion { diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenCacheAccessContext.java b/src/main/java/com/microsoft/aad/msal4j/TokenCacheAccessContext.java index 59f50982..9ac8d9e4 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenCacheAccessContext.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenCacheAccessContext.java @@ -8,7 +8,7 @@ import lombok.experimental.Accessors; /** - * State of token cache + * Context in which the the token cache is accessed */ @Builder @Accessors(fluent = true) diff --git a/src/main/java/com/microsoft/aad/msal4j/UserAssertion.java b/src/main/java/com/microsoft/aad/msal4j/UserAssertion.java index 6cacba74..25bed3b1 100644 --- a/src/main/java/com/microsoft/aad/msal4j/UserAssertion.java +++ b/src/main/java/com/microsoft/aad/msal4j/UserAssertion.java @@ -4,8 +4,8 @@ package com.microsoft.aad.msal4j; /*** - * Credential type containing an assertion representing user credential. Used as a parameter in - * {@link OnBehalfOfParameters} + * Credential type containing an assertion representing a delegated user identity. + * Used as a parameter in {@link OnBehalfOfParameters} */ public class UserAssertion implements IUserAssertion { From 40508fd04e656e8e7d3d710797938edcac04d958 Mon Sep 17 00:00:00 2001 From: sgonzalezMSFT Date: Tue, 9 Jul 2019 17:03:32 -0700 Subject: [PATCH 12/16] Rename exceptions. Add MsalInteractionRequiredException. --- .../aad/msal4j/AadInstanceDiscovery.java | 2 +- ...uireTokenByAuthorizationGrantSupplier.java | 8 ++- .../AcquireTokenByDeviceCodeFlowSupplier.java | 4 +- .../aad/msal4j/AuthenticationErrorCode.java | 36 +++++++++- .../msal4j/AuthenticationResultSupplier.java | 5 +- .../aad/msal4j/ClientApplicationBase.java | 2 +- .../msal4j/ConfidentialClientApplication.java | 2 +- .../com/microsoft/aad/msal4j/HttpHelper.java | 4 +- .../IConfidentialClientApplication.java | 2 +- .../aad/msal4j/IPublicClientApplication.java | 2 +- .../com/microsoft/aad/msal4j/JwtHelper.java | 15 +---- ...xception.java => MsalClientException.java} | 10 +-- ...ationException.java => MsalException.java} | 26 ++++---- .../MsalInteractionRequiredException.java | 29 ++++++++ ...ception.java => MsalServiceException.java} | 34 ++++------ .../msal4j/MsalServiceExceptionFactory.java | 57 ++++++++++++++++ .../aad/msal4j/OAuthHttpRequest.java | 2 +- .../aad/msal4j/OnBehalfOfRequest.java | 2 +- .../ServiceExceptionClassification.java | 66 +++++++++++++++++++ .../microsoft/aad/msal4j/TokenRequest.java | 44 ++----------- .../microsoft/aad/msal4j/WSTrustRequest.java | 7 +- .../aad/msal4j/DeviceCodeFlowTest.java | 4 +- .../microsoft/aad/msal4j/HttpHelperTest.java | 2 +- .../msal4j/OAuthRequestValidationTest.java | 9 ++- .../aad/msal4j/TokenRequestTest.java | 26 ++++---- 25 files changed, 269 insertions(+), 131 deletions(-) rename src/main/java/com/microsoft/aad/msal4j/{AuthenticationClientException.java => MsalClientException.java} (87%) rename src/main/java/com/microsoft/aad/msal4j/{AuthenticationException.java => MsalException.java} (77%) create mode 100644 src/main/java/com/microsoft/aad/msal4j/MsalInteractionRequiredException.java rename src/main/java/com/microsoft/aad/msal4j/{AuthenticationServiceException.java => MsalServiceException.java} (82%) create mode 100644 src/main/java/com/microsoft/aad/msal4j/MsalServiceExceptionFactory.java create mode 100644 src/main/java/com/microsoft/aad/msal4j/ServiceExceptionClassification.java diff --git a/src/main/java/com/microsoft/aad/msal4j/AadInstanceDiscovery.java b/src/main/java/com/microsoft/aad/msal4j/AadInstanceDiscovery.java index 5704481d..fa3f4b5e 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AadInstanceDiscovery.java +++ b/src/main/java/com/microsoft/aad/msal4j/AadInstanceDiscovery.java @@ -87,7 +87,7 @@ private static String getInstanceDiscoveryEndpoint(String host) { private static void validate(InstanceDiscoveryResponse instanceDiscoveryResponse) { if (StringHelper.isBlank(instanceDiscoveryResponse.tenantDiscoveryEndpoint())) { - throw new AuthenticationServiceException(instanceDiscoveryResponse); + throw new MsalServiceException(instanceDiscoveryResponse); } } diff --git a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByAuthorizationGrantSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByAuthorizationGrantSupplier.java index 6185e9b2..b27ba76d 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByAuthorizationGrantSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByAuthorizationGrantSupplier.java @@ -153,10 +153,14 @@ private AuthorizationGrant getAuthorizationGrantIntegrated(String userName) thro updatedGrant = getSAMLAuthorizationGrant(wsTrustResponse); } else if (userRealmResponse.isAccountManaged()) { - throw new AuthenticationException("Password is required for managed user"); + throw new MsalClientException( + "Password is required for managed user", + AuthenticationErrorCode.PASSWORD_REQUIRED_FOR_MANAGED_USER); } else{ - throw new AuthenticationException("Unknown User Type"); + throw new MsalClientException( + "User Realm request failed", + AuthenticationErrorCode.USER_REALM_DISCOVERY_FAILED); } return updatedGrant; diff --git a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java index 42151c12..40012098 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AcquireTokenByDeviceCodeFlowSupplier.java @@ -77,7 +77,7 @@ private AuthenticationResult acquireTokenWithDeviceCode(DeviceCode deviceCode, } try { return acquireTokenByAuthorisationGrantSupplier.execute(); - } catch (AuthenticationServiceException ex) { + } catch (MsalServiceException ex) { if (ex.errorCode().equals(AUTHORIZATION_PENDING)) { TimeUnit.SECONDS.sleep(deviceCode.interval()); } else { @@ -85,7 +85,7 @@ private AuthenticationResult acquireTokenWithDeviceCode(DeviceCode deviceCode, } } } - throw new AuthenticationClientException("Expired Device code"); + throw new MsalClientException("Expired Device code", AuthenticationErrorCode.CODE_EXPIRED); } private Long getCurrentSystemTimeInSeconds(){ diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java index dd7050ab..061d3e4f 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java @@ -25,8 +25,42 @@ public class AuthenticationErrorCode { + /** + * In the context of device code user has not yet authenticated via browser + */ public final static String AUTHORIZATION_PENDING = "authorization_pending"; - public final static String INTERACTION_REQUIRED = "interaction_required"; + + /** + * In the context of device code, this error happens when the device code has expired before + * the user signed-in on another device (this is usually after 15 min) + */ + public final static String CODE_EXPIRED = "code_expired"; + + /** + * Standard Oauth2 protocol error code. It indicates that the application needs to expose + * the UI to the user so that user does an interactive action in order to get a new token + */ public final static String INVALID_GRANT = "invalid_grant"; + + /** + * WS-Trust Endpoint not found in Metadata document + */ + public final static String WSTRUST_ENDPOINT_NOT_FOUND_IN_METADATA_DOCUMENT = "wstrust_endpoint_not_found"; + + /** + * Password is required for managed user. Will typically happen when trying to do integrated windows authentication + * for managed users + */ + public final static String PASSWORD_REQUIRED_FOR_MANAGED_USER = "password_required_for_managed_user"; + + /** + * User realm discovery failed + */ + public final static String USER_REALM_DISCOVERY_FAILED = "user_realm_discovery_failed"; + + /** + * Unknown error occurred + */ public final static String UNKNOWN = "unknown"; } + diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java index 70759af2..1a364f33 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationResultSupplier.java @@ -31,7 +31,6 @@ import java.net.URL; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; -import java.util.Set; import java.util.concurrent.CompletionException; import java.util.function.Supplier; @@ -84,8 +83,8 @@ public IAuthenticationResult get() { } } catch(Exception ex) { - if (ex instanceof AuthenticationServiceException) { - apiEvent.setApiErrorCode(((AuthenticationServiceException) ex).errorCode()); + if (ex instanceof MsalServiceException) { + apiEvent.setApiErrorCode(((MsalServiceException) ex).errorCode()); } clientApplication.log.error( diff --git a/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java b/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java index cf053487..956c8907 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java +++ b/src/main/java/com/microsoft/aad/msal4j/ClientApplicationBase.java @@ -409,7 +409,7 @@ private static Authority createDefaultAADAuthority() { try { authority = new AADAuthority(new URL(DEFAULT_AUTHORITY)); } catch(Exception e){ - throw new AuthenticationClientException(e); + throw new MsalClientException(e); } return authority; } diff --git a/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java index 1a6ce54c..556bc283 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java @@ -103,7 +103,7 @@ private ClientAuthentication createClientAuthFromClientAssertion( map.put("client_assertion", Collections.singletonList(clientAssertion.assertion())); return PrivateKeyJWT.parse(map); } catch (final ParseException e) { - throw new AuthenticationClientException(e); + throw new MsalClientException(e); } } diff --git a/src/main/java/com/microsoft/aad/msal4j/HttpHelper.java b/src/main/java/com/microsoft/aad/msal4j/HttpHelper.java index 44786250..9590b9cd 100644 --- a/src/main/java/com/microsoft/aad/msal4j/HttpHelper.java +++ b/src/main/java/com/microsoft/aad/msal4j/HttpHelper.java @@ -168,7 +168,7 @@ static void verifyReturnedCorrelationId(Logger log, } static String readResponseFromConnection(final HttpsURLConnection conn, HttpEvent httpEvent) - throws AuthenticationException, IOException { + throws MsalServiceException, IOException { InputStream is = null; try { int responseCode = conn.getResponseCode(); @@ -181,7 +181,7 @@ static String readResponseFromConnection(final HttpsURLConnection conn, HttpEven msg = msg + ", Error details : " + inputStreamToString(is); } httpEvent.setOauthErrorCode(AuthenticationErrorCode.UNKNOWN); - throw new AuthenticationServiceException(msg); + throw new MsalServiceException(msg, AuthenticationErrorCode.UNKNOWN); } is = conn.getInputStream(); diff --git a/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java index 07e43bc9..0d264cf7 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/IConfidentialClientApplication.java @@ -48,7 +48,7 @@ public interface IConfidentialClientApplication extends IClientApplicationBase { * {@link IAuthenticationResult} of the call. It contains Access * Token and the Access Token's expiration time. Refresh Token * property will be null for this overload. - * @throws AuthenticationException {@link AuthenticationException} + * @throws MsalException {@link MsalException} */ CompletableFuture acquireToken(OnBehalfOfParameters parameters); } diff --git a/src/main/java/com/microsoft/aad/msal4j/IPublicClientApplication.java b/src/main/java/com/microsoft/aad/msal4j/IPublicClientApplication.java index 5c534c24..b652ad54 100644 --- a/src/main/java/com/microsoft/aad/msal4j/IPublicClientApplication.java +++ b/src/main/java/com/microsoft/aad/msal4j/IPublicClientApplication.java @@ -66,7 +66,7 @@ public interface IPublicClientApplication extends IClientApplicationBase { * @param parameters#deviceCodeConsumer * @return A {@link CompletableFuture} object representing the {@link IAuthenticationResult} of the call. * It contains AccessTokenCacheEntity, Refresh Token and the Access Token's expiration time. - * @throws AuthenticationException thrown if authorization is pending or another error occurred. + * @throws MsalException thrown if authorization is pending or another error occurred. * If the errorCode of the exception is AuthenticationErrorCode.AUTHORIZATION_PENDING, * the call needs to be retried until the AccessToken is returned. * DeviceCode.interval - The minimum amount of time in seconds that the client diff --git a/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java b/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java index afb3864b..6af910ed 100644 --- a/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java +++ b/src/main/java/com/microsoft/aad/msal4j/JwtHelper.java @@ -38,19 +38,10 @@ import com.nimbusds.jwt.JWTClaimsSet; import com.nimbusds.jwt.SignedJWT; -/** - * - */ final class JwtHelper { - /** - * Builds JWT object. - * - * @param credential - * @return - * @throws AuthenticationException - */ + static ClientAssertion buildJwt(String clientId, final AsymmetricKeyCredential credential, - final String jwtAudience) throws AuthenticationException { + final String jwtAudience) throws MsalClientException { if (StringHelper.isBlank(clientId)) { throw new IllegalArgumentException("clientId is null or empty"); } @@ -86,7 +77,7 @@ static ClientAssertion buildJwt(String clientId, final AsymmetricKeyCredential c jwt.sign(signer); } catch (final Exception e) { - throw new AuthenticationClientException(e); + throw new MsalClientException(e); } return new ClientAssertion(jwt.serialize()); diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationClientException.java b/src/main/java/com/microsoft/aad/msal4j/MsalClientException.java similarity index 87% rename from src/main/java/com/microsoft/aad/msal4j/AuthenticationClientException.java rename to src/main/java/com/microsoft/aad/msal4j/MsalClientException.java index 6bdc1e93..a4fb2de5 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationClientException.java +++ b/src/main/java/com/microsoft/aad/msal4j/MsalClientException.java @@ -26,13 +26,13 @@ /** * Exception type thrown when and error occurs that is local to the library or the device. */ -public class AuthenticationClientException extends AuthenticationException{ +public class MsalClientException extends MsalException { /** - * Initializes a new instance of the exception class with a specified error message + * Initializes a new instance of the exception class with a instance of Throwable * @param throwable the inner exception that is the cause of the current exception */ - public AuthenticationClientException(final Throwable throwable){ + public MsalClientException(final Throwable throwable){ super(throwable); } @@ -40,7 +40,7 @@ public AuthenticationClientException(final Throwable throwable){ * Initializes a new instance of the exception class with a specified error message * @param message the error message that explains the reason for the exception */ - public AuthenticationClientException(final String message){ - super(message); + public MsalClientException(final String message, final String errorCode){ + super(message, errorCode); } } diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java b/src/main/java/com/microsoft/aad/msal4j/MsalException.java similarity index 77% rename from src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java rename to src/main/java/com/microsoft/aad/msal4j/MsalException.java index 2c88a3d5..adaf0f17 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationException.java +++ b/src/main/java/com/microsoft/aad/msal4j/MsalException.java @@ -23,35 +23,37 @@ package com.microsoft.aad.msal4j; +import lombok.Getter; +import lombok.experimental.Accessors; + /** * Base exception type thrown when an error occurs during token acquisition. */ -public class AuthenticationException extends RuntimeException { +public class MsalException extends RuntimeException { private static final long serialVersionUID = 1L; /** - * Initializes a new instance of the exception class - * @param throwable the inner exception that is the cause of the current exception + * Authentication error code */ - public AuthenticationException(final Throwable throwable) { - super(throwable); - } + @Accessors(fluent = true) + @Getter + private String errorCode; /** * Initializes a new instance of the exception class - * @param message the error message that explains the reason for the exception + * @param throwable the inner exception that is the cause of the current exception */ - public AuthenticationException(final String message) { - super(message); + public MsalException(final Throwable throwable) { + super(throwable); } /** * Initializes a new instance of the exception class * @param message the error message that explains the reason for the exception - * @param t the inner exception that is the cause of the current exception */ - public AuthenticationException(final String message, final Throwable t) { - super(message, t); + public MsalException(final String message, String errorCode) { + super(message); + this.errorCode = errorCode; } } diff --git a/src/main/java/com/microsoft/aad/msal4j/MsalInteractionRequiredException.java b/src/main/java/com/microsoft/aad/msal4j/MsalInteractionRequiredException.java new file mode 100644 index 00000000..4dec3560 --- /dev/null +++ b/src/main/java/com/microsoft/aad/msal4j/MsalInteractionRequiredException.java @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.aad.msal4j; + +import lombok.Getter; +import lombok.experimental.Accessors; + +import java.util.List; +import java.util.Map; + +/** + * This exception class is to inform developers that UI interaction is required for authentication + * to succeed. + */ +public class MsalInteractionRequiredException extends MsalServiceException{ + + @Accessors(fluent = true) + @Getter + private ServiceExceptionClassification classification; + + public MsalInteractionRequiredException( + ErrorResponse errorResponse, + Map> headerMap) { + super(errorResponse, headerMap); + + classification = ServiceExceptionClassification.fromSubErrorString(errorResponse.subError); + } +} diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationServiceException.java b/src/main/java/com/microsoft/aad/msal4j/MsalServiceException.java similarity index 82% rename from src/main/java/com/microsoft/aad/msal4j/AuthenticationServiceException.java rename to src/main/java/com/microsoft/aad/msal4j/MsalServiceException.java index 6d8f2290..fb5d3e29 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationServiceException.java +++ b/src/main/java/com/microsoft/aad/msal4j/MsalServiceException.java @@ -23,6 +23,7 @@ package com.microsoft.aad.msal4j; +import lombok.AccessLevel; import lombok.Getter; import lombok.experimental.Accessors; @@ -34,17 +35,7 @@ */ @Accessors(fluent = true) @Getter -public class AuthenticationServiceException extends AuthenticationException{ - - /** - * The protocol error code returned by the service - */ - private String errorCode; - - /** - * More specific error - */ - private String subError; +public class MsalServiceException extends MsalException { /** * Status code returned from http layer @@ -57,7 +48,7 @@ public class AuthenticationServiceException extends AuthenticationException{ private String statusMessage; /** - * An ID that can used to piece up a single authentication flow. + * An ID that can be used to piece up a single authentication flow. */ private String correlationId; @@ -73,12 +64,16 @@ public class AuthenticationServiceException extends AuthenticationException{ */ private Map> headers; + @Accessors(fluent = true) + @Getter(AccessLevel.PACKAGE) + private String subError; + /** * Initializes a new instance of the exception class with a specified error message * @param message the error message that explains the reason for the exception */ - public AuthenticationServiceException(final String message){ - super(message); + public MsalServiceException(final String message, final String error){ + super(message, error); } /** @@ -86,13 +81,12 @@ public AuthenticationServiceException(final String message){ * @param errorResponse response object contain information about error returned by server * @param httpHeaders http headers from the server response */ - public AuthenticationServiceException( + public MsalServiceException( final ErrorResponse errorResponse, final Map> httpHeaders) { - super(errorResponse.errorDescription); + super(errorResponse.errorDescription, errorResponse.error()); - this.errorCode = errorResponse.error(); this.statusCode = errorResponse.statusCode(); this.statusMessage = errorResponse.statusMessage(); this.subError = errorResponse.subError(); @@ -105,11 +99,9 @@ public AuthenticationServiceException( * Initializes a new instance of the exception class * @param discoveryResponse response object from instance discovery network call */ - public AuthenticationServiceException(InstanceDiscoveryResponse discoveryResponse){ - - super(discoveryResponse.errorDescription()); + public MsalServiceException(final InstanceDiscoveryResponse discoveryResponse){ + super(discoveryResponse.errorDescription(), discoveryResponse.error()); - this.errorCode = discoveryResponse.error(); this.correlationId = discoveryResponse.correlationId(); } } diff --git a/src/main/java/com/microsoft/aad/msal4j/MsalServiceExceptionFactory.java b/src/main/java/com/microsoft/aad/msal4j/MsalServiceExceptionFactory.java new file mode 100644 index 00000000..4c36e8cc --- /dev/null +++ b/src/main/java/com/microsoft/aad/msal4j/MsalServiceExceptionFactory.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.aad.msal4j; + +import com.nimbusds.oauth2.sdk.http.HTTPResponse; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +class MsalServiceExceptionFactory { + + private MsalServiceExceptionFactory(){ + } + + static MsalServiceException fromHttpResponse(HTTPResponse httpResponse){ + + String responseContent = httpResponse.getContent(); + if(responseContent == null || StringHelper.isBlank(responseContent)){ + return new MsalServiceException( + "Unknown Service Exception", + AuthenticationErrorCode.UNKNOWN); + } + + ErrorResponse errorResponse = JsonHelper.convertJsonToObject( + responseContent, + ErrorResponse.class); + + errorResponse.statusCode(httpResponse.getStatusCode()); + errorResponse.statusMessage(httpResponse.getStatusMessage()); + + if(errorResponse.error() != null && + errorResponse.error().equalsIgnoreCase(AuthenticationErrorCode.INVALID_GRANT)) { + + if(isInteractionRequired(errorResponse.subError)){ + throw new MsalInteractionRequiredException(errorResponse, httpResponse.getHeaderMap()); + } + } + + return new MsalServiceException( + errorResponse, + httpResponse.getHeaderMap()); + } + + private static boolean isInteractionRequired(String subError){ + + String[] nonUiSubErrors = {"client_mismatch", "protection_policy_required"}; + Set set = new HashSet<>(Arrays.asList(nonUiSubErrors)); + + if(StringHelper.isBlank(subError)){ + return true; + } + + return !set.contains(subError); + } +} diff --git a/src/main/java/com/microsoft/aad/msal4j/OAuthHttpRequest.java b/src/main/java/com/microsoft/aad/msal4j/OAuthHttpRequest.java index 9abf2952..3347e39c 100644 --- a/src/main/java/com/microsoft/aad/msal4j/OAuthHttpRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/OAuthHttpRequest.java @@ -100,7 +100,7 @@ private HTTPResponse createResponse(final HttpURLConnection conn, final String o Map> headers = conn.getHeaderFields(); for(Map.Entry> header: headers.entrySet()){ - if(header.getKey() == null || StringHelper.isBlank(header.getKey())){ + if(StringHelper.isBlank(header.getKey())){ continue; } diff --git a/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfRequest.java b/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfRequest.java index 7b36d190..66e71223 100644 --- a/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/OnBehalfOfRequest.java @@ -50,7 +50,7 @@ private static OAuthAuthorizationGrant createAuthenticationGrant(OnBehalfOfParam try { jWTBearerGrant = new JWTBearerGrant(SignedJWT.parse(parameters.userAssertion().getAssertion())); } catch (Exception e) { - throw new AuthenticationClientException(e); + throw new MsalClientException(e); } Map> params = new HashMap<>(); diff --git a/src/main/java/com/microsoft/aad/msal4j/ServiceExceptionClassification.java b/src/main/java/com/microsoft/aad/msal4j/ServiceExceptionClassification.java new file mode 100644 index 00000000..d131a944 --- /dev/null +++ b/src/main/java/com/microsoft/aad/msal4j/ServiceExceptionClassification.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +package com.microsoft.aad.msal4j; + +/** + * Details about the cause of an {@link MsalInteractionRequiredException}, giving a hint about the + * user can expect when they go through interactive authentication + */ +public enum ServiceExceptionClassification { + + /** + * No further details are provided. It is possible that the user will be able to resolve the issue + * by launching interactive authentication + */ + NONE("none"), + + /** + * Issue cannot be resolved at this time. Launching interactive authentication flow will show a + * message explaining the condition + */ + MESSAGE_ONLY("message_only"), + + /** + * Issue can be resolved by user interaction during the interactive authentication flow. + */ + BASIC_ACTION("basic_action"), + + /** + * Issue can be resolved by remedial interaction with the system, outside of the interactive + * authentication flow. Starting an interactive authentication flow will show the user what they + * need to to do, but it is possible that the user is unable to complete the action + */ + ADDITIONAL_ACTION("additional_action"), + + /** + * User consent is missing, or has been revoked. Issue can be resolved by user consenting during + * the interactive authentication flow + */ + CONSENT_REQUIRED("consent_required"), + + /** + * User's password has expired. Issue can be resolved by user during the interactive authentication + * flow + */ + USER_PASSWORD_EXPIRED("user_password_expired"); + + private String error; + + ServiceExceptionClassification(String error){ + this.error = error; + } + + static ServiceExceptionClassification fromSubErrorString(String subError){ + if(StringHelper.isBlank(subError)){ + return NONE; + } + + for(ServiceExceptionClassification classification: ServiceExceptionClassification.values()){ + if(classification.error.equalsIgnoreCase(subError)){ + return classification; + } + } + return NONE; + } +} diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java b/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java index 3dfeb7cd..be264df6 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java @@ -61,7 +61,7 @@ class TokenRequest { } AuthenticationResult executeOauthRequestAndProcessResponse() - throws ParseException, AuthenticationException, SerializeException, + throws ParseException, MsalServiceException, SerializeException, IOException { HttpEvent httpEvent = createHttpEvent(); @@ -130,50 +130,14 @@ AuthenticationResult executeOauthRequestAndProcessResponse() build(); } else { - - String responseContent = httpResponse.getContent(); - if(responseContent == null || StringHelper.isBlank(responseContent)){ - throw new AuthenticationServiceException("Unknown Service Exception"); - } - - ErrorResponse errorResponse = JsonHelper.convertJsonToObject( - responseContent, - ErrorResponse.class); - - errorResponse.statusCode(httpResponse.getStatusCode()); - errorResponse.statusMessage(httpResponse.getStatusMessage()); - - // Some invalid_grant or interaction_required subError codes returned by - // the service are not supposed to be exposed to customers - if(errorResponse.error() != null && - errorResponse.error().equalsIgnoreCase(AuthenticationErrorCode.INVALID_GRANT) || - errorResponse.error().equalsIgnoreCase(AuthenticationErrorCode.INTERACTION_REQUIRED)){ - errorResponse = filterSubErrorCode(errorResponse); - } - - httpEvent.setOauthErrorCode(errorResponse.error()); - - throw new AuthenticationServiceException( - errorResponse, - httpResponse.getHeaderMap()); + MsalServiceException exception = MsalServiceExceptionFactory.fromHttpResponse(httpResponse); + httpEvent.setOauthErrorCode(exception.errorCode()); + throw exception; } return result; } } - private ErrorResponse filterSubErrorCode(ErrorResponse errorResponse){ - String[] errorsThatShouldNotBeExposed = {"bad_token", "token_expired", - "protection_policy_required", "client_mismatch", "device_authentication_failed"}; - - Set set = new HashSet<>(Arrays.asList(errorsThatShouldNotBeExposed)); - - if(set.contains(errorResponse.subError)){ - errorResponse.subError(""); - } - - return errorResponse; - } - private void addResponseHeadersToHttpEvent(HttpEvent httpEvent, HTTPResponse httpResponse) { httpEvent.setHttpResponseStatus(httpResponse.getStatusCode()); diff --git a/src/main/java/com/microsoft/aad/msal4j/WSTrustRequest.java b/src/main/java/com/microsoft/aad/msal4j/WSTrustRequest.java index 5497daae..c23f5a11 100644 --- a/src/main/java/com/microsoft/aad/msal4j/WSTrustRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/WSTrustRequest.java @@ -88,7 +88,9 @@ static WSTrustResponse execute(String url, BindingPolicy policy = MexParser.getWsTrustEndpointFromMexResponse(mexResponse, logPii); if(policy == null){ - throw new AuthenticationServiceException("WsTrust endpoint not found in metadata document"); + throw new MsalServiceException( + "WsTrust endpoint not found in metadata document", + AuthenticationErrorCode.WSTRUST_ENDPOINT_NOT_FOUND_IN_METADATA_DOCUMENT); } return execute(username, password, cloudAudienceUrn, policy, requestContext, serviceBundle); @@ -112,7 +114,8 @@ static WSTrustResponse execute(String mexURL, BindingPolicy policy = MexParser.getPolicyFromMexResponseForIntegrated(mexResponse, logPii); if(policy == null){ - throw new AuthenticationServiceException("WsTrust endpoint not found in metadata document"); + throw new MsalServiceException("WsTrust endpoint not found in metadata document", + AuthenticationErrorCode.WSTRUST_ENDPOINT_NOT_FOUND_IN_METADATA_DOCUMENT); } return execute(null, null, cloudAudienceUrn, policy, requestContext, serviceBundle); diff --git a/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java b/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java index cc977c7c..d043a1d8 100644 --- a/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/DeviceCodeFlowTest.java @@ -261,8 +261,8 @@ public void executeAcquireDeviceCode_AuthenticaionPendingErrorReturned_Authentic try { request.executeOauthRequestAndProcessResponse(); - Assert.fail("Expected AuthenticationException was not thrown"); - } catch (AuthenticationServiceException ex) { + Assert.fail("Expected MsalException was not thrown"); + } catch (MsalServiceException ex) { Assert.assertEquals(ex.errorCode(), AuthenticationErrorCode.AUTHORIZATION_PENDING); } diff --git a/src/test/java/com/microsoft/aad/msal4j/HttpHelperTest.java b/src/test/java/com/microsoft/aad/msal4j/HttpHelperTest.java index 0318b3dc..74caec5a 100644 --- a/src/test/java/com/microsoft/aad/msal4j/HttpHelperTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/HttpHelperTest.java @@ -39,7 +39,7 @@ @Test(groups = { "checkin" }) public class HttpHelperTest extends AbstractMsalTests { - @Test(expectedExceptions = AuthenticationException.class, + @Test(expectedExceptions = MsalException.class, expectedExceptionsMessageRegExp = "Server returned HTTP response code: 403 for URL : https://some.url, Error details : error info") public void testReadResponseFromConnection_ResponseCodeNot200() throws Exception { diff --git a/src/test/java/com/microsoft/aad/msal4j/OAuthRequestValidationTest.java b/src/test/java/com/microsoft/aad/msal4j/OAuthRequestValidationTest.java index 9fa3bb29..cea3332b 100644 --- a/src/test/java/com/microsoft/aad/msal4j/OAuthRequestValidationTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/OAuthRequestValidationTest.java @@ -64,7 +64,6 @@ import java.util.Map; import java.util.UUID; import java.util.concurrent.ExecutionException; -import java.util.concurrent.Future; import org.easymock.EasyMock; import org.powermock.api.easymock.PowerMock; @@ -105,7 +104,7 @@ public void init() { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { OAuthRequestValidationTest.query = ((OAuthHttpRequest) proxy).getQuery(); - throw new AuthenticationException(""); + throw new MsalException("", AuthenticationErrorCode.UNKNOWN); } }); } @@ -175,7 +174,7 @@ public void oAuthRequest_for_acquireTokenByUserAssertion() throws Exception { app.acquireToken(parameters).get(); } catch (ExecutionException ex) { - Assert.assertTrue(ex.getCause() instanceof AuthenticationException); + Assert.assertTrue(ex.getCause() instanceof MsalException); } Map queryParams = splitQuery(query); @@ -241,7 +240,7 @@ public void oAuthRequest_for_acquireTokenByAsymmetricKeyCredential() throws Exce app.acquireToken(parameters).get(); } catch (ExecutionException ex) { - Assert.assertTrue(ex.getCause() instanceof AuthenticationException); + Assert.assertTrue(ex.getCause() instanceof MsalException); } Map queryParams = splitQuery(query); @@ -292,7 +291,7 @@ public void oAuthRequest_for_acquireTokenByClientAssertion() throws Exception { .get(); } catch (ExecutionException ex) { - Assert.assertTrue(ex.getCause() instanceof AuthenticationException); + Assert.assertTrue(ex.getCause() instanceof MsalException); } Map queryParams = splitQuery(query); diff --git a/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java b/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java index 099ceaf6..c6debf6b 100644 --- a/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java @@ -23,14 +23,12 @@ package com.microsoft.aad.msal4j; -import com.nimbusds.oauth2.sdk.ErrorObject; import com.nimbusds.oauth2.sdk.ParseException; import com.nimbusds.oauth2.sdk.SerializeException; import com.nimbusds.oauth2.sdk.TokenErrorResponse; import com.nimbusds.oauth2.sdk.http.CommonContentTypes; import com.nimbusds.oauth2.sdk.http.HTTPResponse; import com.nimbusds.oauth2.sdk.util.JSONObjectUtils; -import net.minidev.json.JSONObject; import org.easymock.EasyMock; import org.powermock.api.easymock.PowerMock; import org.powermock.core.classloader.annotations.PrepareForTest; @@ -51,7 +49,7 @@ public class TokenRequestTest extends AbstractMsalTests { @Test public void executeOAuthRequest_SCBadRequestErrorInteractionRequired_AuthenticationServiceException() - throws SerializeException, ParseException, AuthenticationException, + throws SerializeException, ParseException, MsalException, IOException, URISyntaxException { TokenRequest request = createMockedTokenRequest(); @@ -80,16 +78,16 @@ public void executeOAuthRequest_SCBadRequestErrorInteractionRequired_Authenticat try { request.executeOauthRequestAndProcessResponse(); - Assert.fail("Expected AuthenticationServiceException was not thrown"); - } catch (AuthenticationServiceException ex) { + Assert.fail("Expected MsalServiceException was not thrown"); + } catch (MsalServiceException ex) { Assert.assertEquals(claims.replace("\\", ""), ex.claims()); } PowerMock.verifyAll(); } @Test - public void executeOAuthRequest_SCBadRequestErrorInvalidGrant_SubErrorFiltered() - throws SerializeException, ParseException, AuthenticationException, + public void executeOAuthRequest_SCBadRequestErrorInvalidGrant_InteractionRequiredException() + throws SerializeException, ParseException, MsalException, IOException, URISyntaxException { TokenRequest request = createMockedTokenRequest(); @@ -106,7 +104,7 @@ public void executeOAuthRequest_SCBadRequestErrorInvalidGrant_SubErrorFiltered() "\"timestamp\":\"2017-07-15 02:35:05Z\"," + "\"trace_id\":\"0788...000\"," + "\"correlation_id\":\"3a...95a\"," + - "\"suberror\":\"client_mismatch\"," + + "\"suberror\":\"basic_action\"," + "\"claims\":\"" + claims + "\"}"; httpResponse.setContent(content); httpResponse.setContentType(CommonContentTypes.APPLICATION_JSON); @@ -118,10 +116,10 @@ public void executeOAuthRequest_SCBadRequestErrorInvalidGrant_SubErrorFiltered() try { request.executeOauthRequestAndProcessResponse(); - Assert.fail("Expected AuthenticationServiceException was not thrown"); - } catch (AuthenticationServiceException ex) { + Assert.fail("Expected MsalServiceException was not thrown"); + } catch (MsalInteractionRequiredException ex) { Assert.assertEquals(claims.replace("\\", ""), ex.claims()); - Assert.assertEquals(ex.subError(), ""); + Assert.assertEquals(ex.classification(), ServiceExceptionClassification.BASIC_ACTION); } PowerMock.verifyAll(); } @@ -242,7 +240,7 @@ public void testToOAuthRequestNullCorrelationId_NullClientAuth() } @Test - public void testExecuteOAuth_Success() throws SerializeException, ParseException, AuthenticationException, + public void testExecuteOAuth_Success() throws SerializeException, ParseException, MsalException, IOException, URISyntaxException { PublicClientApplication app = new PublicClientApplication.Builder("id").build(); @@ -307,9 +305,9 @@ public void testExecuteOAuth_Success() throws SerializeException, ParseException Assert.assertFalse(StringHelper.isBlank(result.refreshToken())); } - @Test(expectedExceptions = AuthenticationException.class) + @Test(expectedExceptions = MsalException.class) public void testExecuteOAuth_Failure() throws SerializeException, - ParseException, AuthenticationException, IOException, URISyntaxException { + ParseException, MsalException, IOException, URISyntaxException { PublicClientApplication app = new PublicClientApplication.Builder("id").build(); From 35c7468246055843bd144309ade1b115212b483b Mon Sep 17 00:00:00 2001 From: sgonzalezMSFT Date: Tue, 9 Jul 2019 17:10:57 -0700 Subject: [PATCH 13/16] Add comments to MsalInteractionRequiredException --- .../aad/msal4j/MsalInteractionRequiredException.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/com/microsoft/aad/msal4j/MsalInteractionRequiredException.java b/src/main/java/com/microsoft/aad/msal4j/MsalInteractionRequiredException.java index 4dec3560..8f4dc1a1 100644 --- a/src/main/java/com/microsoft/aad/msal4j/MsalInteractionRequiredException.java +++ b/src/main/java/com/microsoft/aad/msal4j/MsalInteractionRequiredException.java @@ -15,10 +15,19 @@ */ public class MsalInteractionRequiredException extends MsalServiceException{ + /** + * Classification of the conditional access error, enabling you to do more actions or inform the + * user depending on your scenario. + */ @Accessors(fluent = true) @Getter private ServiceExceptionClassification classification; + /** + * Initializes a new instance of the exception class + * @param errorResponse response object contain information about error returned by server + * @param headerMap http headers from the server response + */ public MsalInteractionRequiredException( ErrorResponse errorResponse, Map> headerMap) { From 974f555334677b9fcc519fb84b6c6c9fc0cdcebf Mon Sep 17 00:00:00 2001 From: Santiago Gonzalez Date: Wed, 10 Jul 2019 16:57:23 -0700 Subject: [PATCH 14/16] Fix minor bug --- src/main/java/com/microsoft/aad/msal4j/TokenRequest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java b/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java index 2c69d3d0..2f13a512 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java @@ -154,7 +154,7 @@ private HttpEvent createHttpEvent() throws MalformedURLException { return httpEvent; } - OAuthHttpRequest toOauthHttpRequest() throws SerializeException { + OAuthHttpRequest toOauthHttpRequest() throws SerializeException, MalformedURLException { if (requestAuthority.tokenEndpointUrl() == null) { throw new SerializeException("The endpoint URI is not specified"); From e6d5ea5a0d53a31baa2b173a788c2e2b2e995d42 Mon Sep 17 00:00:00 2001 From: sgonzalezMSFT Date: Thu, 11 Jul 2019 14:49:37 -0700 Subject: [PATCH 15/16] Pr Feedback --- ...> InteractionRequiredExceptionReason.java} | 13 +++++----- .../aad/msal4j/MsalClientException.java | 24 ++--------------- .../MsalInteractionRequiredException.java | 6 ++--- .../aad/msal4j/MsalServiceException.java | 24 ++--------------- .../msal4j/MsalServiceExceptionFactory.java | 3 +++ .../microsoft/aad/msal4j/TokenRequest.java | 4 --- .../aad/msal4j/TokenRequestTest.java | 26 ++++++++++--------- 7 files changed, 31 insertions(+), 69 deletions(-) rename src/main/java/com/microsoft/aad/msal4j/{ServiceExceptionClassification.java => InteractionRequiredExceptionReason.java} (81%) diff --git a/src/main/java/com/microsoft/aad/msal4j/ServiceExceptionClassification.java b/src/main/java/com/microsoft/aad/msal4j/InteractionRequiredExceptionReason.java similarity index 81% rename from src/main/java/com/microsoft/aad/msal4j/ServiceExceptionClassification.java rename to src/main/java/com/microsoft/aad/msal4j/InteractionRequiredExceptionReason.java index d131a944..9ad18790 100644 --- a/src/main/java/com/microsoft/aad/msal4j/ServiceExceptionClassification.java +++ b/src/main/java/com/microsoft/aad/msal4j/InteractionRequiredExceptionReason.java @@ -7,7 +7,7 @@ * Details about the cause of an {@link MsalInteractionRequiredException}, giving a hint about the * user can expect when they go through interactive authentication */ -public enum ServiceExceptionClassification { +public enum InteractionRequiredExceptionReason { /** * No further details are provided. It is possible that the user will be able to resolve the issue @@ -47,18 +47,19 @@ public enum ServiceExceptionClassification { private String error; - ServiceExceptionClassification(String error){ + InteractionRequiredExceptionReason(String error){ this.error = error; } - static ServiceExceptionClassification fromSubErrorString(String subError){ + static InteractionRequiredExceptionReason fromSubErrorString(String subError){ if(StringHelper.isBlank(subError)){ return NONE; } - for(ServiceExceptionClassification classification: ServiceExceptionClassification.values()){ - if(classification.error.equalsIgnoreCase(subError)){ - return classification; + for(InteractionRequiredExceptionReason reason: + InteractionRequiredExceptionReason.values()){ + if(reason.error.equalsIgnoreCase(subError)){ + return reason; } } return NONE; diff --git a/src/main/java/com/microsoft/aad/msal4j/MsalClientException.java b/src/main/java/com/microsoft/aad/msal4j/MsalClientException.java index a4fb2de5..ce0e4bc5 100644 --- a/src/main/java/com/microsoft/aad/msal4j/MsalClientException.java +++ b/src/main/java/com/microsoft/aad/msal4j/MsalClientException.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/MsalInteractionRequiredException.java b/src/main/java/com/microsoft/aad/msal4j/MsalInteractionRequiredException.java index 8f4dc1a1..a9e4f495 100644 --- a/src/main/java/com/microsoft/aad/msal4j/MsalInteractionRequiredException.java +++ b/src/main/java/com/microsoft/aad/msal4j/MsalInteractionRequiredException.java @@ -16,12 +16,12 @@ public class MsalInteractionRequiredException extends MsalServiceException{ /** - * Classification of the conditional access error, enabling you to do more actions or inform the + * Reason for the MsalInteractionRequiredException, enabling you to do more actions or inform the * user depending on your scenario. */ @Accessors(fluent = true) @Getter - private ServiceExceptionClassification classification; + private InteractionRequiredExceptionReason reason; /** * Initializes a new instance of the exception class @@ -33,6 +33,6 @@ public MsalInteractionRequiredException( Map> headerMap) { super(errorResponse, headerMap); - classification = ServiceExceptionClassification.fromSubErrorString(errorResponse.subError); + reason = InteractionRequiredExceptionReason.fromSubErrorString(errorResponse.subError); } } diff --git a/src/main/java/com/microsoft/aad/msal4j/MsalServiceException.java b/src/main/java/com/microsoft/aad/msal4j/MsalServiceException.java index fb5d3e29..8c8aa3a4 100644 --- a/src/main/java/com/microsoft/aad/msal4j/MsalServiceException.java +++ b/src/main/java/com/microsoft/aad/msal4j/MsalServiceException.java @@ -1,25 +1,5 @@ -// Copyright (c) Microsoft Corporation. -// All rights reserved. -// -// This code is licensed under the MIT License. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files(the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions : -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. package com.microsoft.aad.msal4j; diff --git a/src/main/java/com/microsoft/aad/msal4j/MsalServiceExceptionFactory.java b/src/main/java/com/microsoft/aad/msal4j/MsalServiceExceptionFactory.java index 4c36e8cc..9d80065b 100644 --- a/src/main/java/com/microsoft/aad/msal4j/MsalServiceExceptionFactory.java +++ b/src/main/java/com/microsoft/aad/msal4j/MsalServiceExceptionFactory.java @@ -30,6 +30,9 @@ static MsalServiceException fromHttpResponse(HTTPResponse httpResponse){ errorResponse.statusCode(httpResponse.getStatusCode()); errorResponse.statusMessage(httpResponse.getStatusMessage()); + + boolean bool = errorResponse.error().equalsIgnoreCase(AuthenticationErrorCode.INVALID_GRANT); + if(errorResponse.error() != null && errorResponse.error().equalsIgnoreCase(AuthenticationErrorCode.INVALID_GRANT)) { diff --git a/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java b/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java index 2f13a512..42565dac 100644 --- a/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java +++ b/src/main/java/com/microsoft/aad/msal4j/TokenRequest.java @@ -6,13 +6,9 @@ import java.io.IOException; import java.net.MalformedURLException; import java.net.URISyntaxException; -import java.net.URL; -import java.util.Arrays; import java.util.Date; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; import com.nimbusds.oauth2.sdk.ParseException; import com.nimbusds.oauth2.sdk.SerializeException; diff --git a/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java b/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java index 6f504842..e72ce804 100644 --- a/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java +++ b/src/test/java/com/microsoft/aad/msal4j/TokenRequestTest.java @@ -28,25 +28,25 @@ public class TokenRequestTest extends AbstractMsalTests { @Test - public void executeOAuthRequest_SCBadRequestErrorInteractionRequired_AuthenticationServiceException() + public void executeOAuthRequest_SCBadRequestErrorInvalidGrant_InteractionRequiredException() throws SerializeException, ParseException, MsalException, IOException, URISyntaxException { TokenRequest request = createMockedTokenRequest(); - OAuthHttpRequest msalOAuthHttpRequest = PowerMock - .createMock(OAuthHttpRequest.class); + OAuthHttpRequest msalOAuthHttpRequest = PowerMock.createMock(OAuthHttpRequest.class); HTTPResponse httpResponse = new HTTPResponse(HTTPResponse.SC_BAD_REQUEST); String claims = "{\\\"access_token\\\":{\\\"polids\\\":{\\\"essential\\\":true,\\\"values\\\":[\\\"5ce770ea-8690-4747-aa73-c5b3cd509cd4\\\"]}}}"; - String content = "{\"error\":\"interaction_required\"," + - "\"error_description\":\"AADSTS50076: description\\r\\nCorrelation ID: 3a...5a\\r\\nTimestamp:2017-07-15 02:35:05Z\"," + + String content = "{\"error\":\"invalid_grant\"," + + "\"error_description\":\"AADSTS65001: description\\r\\nCorrelation ID: 3a...5a\\r\\nTimestamp:2017-07-15 02:35:05Z\"," + "\"error_codes\":[50076]," + "\"timestamp\":\"2017-07-15 02:35:05Z\"," + "\"trace_id\":\"0788...000\"," + "\"correlation_id\":\"3a...95a\"," + + "\"suberror\":\"basic_action\"," + "\"claims\":\"" + claims + "\"}"; httpResponse.setContent(content); httpResponse.setContentType(CommonContentTypes.APPLICATION_JSON); @@ -59,20 +59,22 @@ public void executeOAuthRequest_SCBadRequestErrorInteractionRequired_Authenticat try { request.executeOauthRequestAndProcessResponse(); Assert.fail("Expected MsalServiceException was not thrown"); - } catch (MsalServiceException ex) { + } catch (MsalInteractionRequiredException ex) { Assert.assertEquals(claims.replace("\\", ""), ex.claims()); + Assert.assertEquals(ex.reason(), InteractionRequiredExceptionReason.BASIC_ACTION); } PowerMock.verifyAll(); } @Test - public void executeOAuthRequest_SCBadRequestErrorInvalidGrant_InteractionRequiredException() + public void executeOAuthRequest_SCBadRequestErrorInvalidGrant_SubErrorFilteredServiceExceptionThrown() throws SerializeException, ParseException, MsalException, IOException, URISyntaxException { TokenRequest request = createMockedTokenRequest(); - OAuthHttpRequest msalOAuthHttpRequest = PowerMock.createMock(OAuthHttpRequest.class); + OAuthHttpRequest msalOAuthHttpRequest = PowerMock + .createMock(OAuthHttpRequest.class); HTTPResponse httpResponse = new HTTPResponse(HTTPResponse.SC_BAD_REQUEST); @@ -84,7 +86,7 @@ public void executeOAuthRequest_SCBadRequestErrorInvalidGrant_InteractionRequire "\"timestamp\":\"2017-07-15 02:35:05Z\"," + "\"trace_id\":\"0788...000\"," + "\"correlation_id\":\"3a...95a\"," + - "\"suberror\":\"basic_action\"," + + "\"suberror\":\"client_mismatch\"," + "\"claims\":\"" + claims + "\"}"; httpResponse.setContent(content); httpResponse.setContentType(CommonContentTypes.APPLICATION_JSON); @@ -97,9 +99,9 @@ public void executeOAuthRequest_SCBadRequestErrorInvalidGrant_InteractionRequire try { request.executeOauthRequestAndProcessResponse(); Assert.fail("Expected MsalServiceException was not thrown"); - } catch (MsalInteractionRequiredException ex) { + } catch (MsalServiceException ex) { Assert.assertEquals(claims.replace("\\", ""), ex.claims()); - Assert.assertEquals(ex.classification(), ServiceExceptionClassification.BASIC_ACTION); + Assert.assertTrue(!(ex instanceof MsalInteractionRequiredException)); } PowerMock.verifyAll(); } @@ -127,7 +129,7 @@ private TokenRequest createMockedTokenRequest() throws URISyntaxException, Malfo return PowerMock.createPartialMock( TokenRequest.class, new String[]{"toOauthHttpRequest"}, - new URL("http://login.windows.net"), + new AADAuthority(new URL(TestConstants.ORGANIZATIONS_AUTHORITY)), acr, serviceBundle); } From 519b989022f31b250b2c801dfc5f00300c1e48d3 Mon Sep 17 00:00:00 2001 From: sgonzalezMSFT Date: Thu, 11 Jul 2019 15:47:29 -0700 Subject: [PATCH 16/16] Release 0.5.0-preview --- README.md | 2 +- changelog.txt | 9 ++++++++- pom.xml | 2 +- .../microsoft/aad/msal4j/AuthenticationErrorCode.java | 3 +++ .../java/com/microsoft/aad/msal4j/SilentParameters.java | 5 +++++ src/samples/web-app-samples-for-msal4j/pom.xml | 2 +- 6 files changed, 19 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a3862e39..3b472ac1 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The MSAL library for Java gives your app the ability to begin using the Microsof ## Versions -Current version - 0.4.0-preview +Current version - 0.5.0-preview You can find the changes for each version in the [change log](https://github.com/AzureAD/microsoft-authentication-library-for-java/blob/master/changelog.txt). diff --git a/changelog.txt b/changelog.txt index 56b054c0..94ac1bf1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,13 @@ +Version 0.5.0-preview +============= +- Refactored AuthenticationException to MsalServiceException, MsalClientException, MsalInteractionRequiredException +- Added cache lookup to acquireToken by client credentials grant +- Updated Javadoc reference +- Updated license headers + Version 0.4.0-preview ============= -- Exposing acquire token by refresh token api +- Exposed acquire token by refresh token api Version 0.3.0-preview ============= diff --git a/pom.xml b/pom.xml index 5eb29e1c..665a29f9 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 com.microsoft.azure msal4j - 0.4.0-preview + 0.5.0-preview jar msal4j diff --git a/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java b/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java index 6d5a77fa..1df4944c 100644 --- a/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java +++ b/src/main/java/com/microsoft/aad/msal4j/AuthenticationErrorCode.java @@ -3,6 +3,9 @@ package com.microsoft.aad.msal4j; +/** + * Class containing error codes returned by the service or generated by the client + */ public class AuthenticationErrorCode { /** diff --git a/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java b/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java index cee62ea1..b9bab07d 100644 --- a/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java +++ b/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java @@ -52,6 +52,11 @@ public static SilentParametersBuilder builder(Set scopes, IAccount accou .account(account); } + /** + * Builder for SilentParameters + * @param scopes scopes application is requesting access to + * @return builder object that can be used to construct SilentParameters + */ public static SilentParametersBuilder builder(Set scopes) { validateNotEmpty("scopes", scopes); diff --git a/src/samples/web-app-samples-for-msal4j/pom.xml b/src/samples/web-app-samples-for-msal4j/pom.xml index eff96a83..09540c3c 100644 --- a/src/samples/web-app-samples-for-msal4j/pom.xml +++ b/src/samples/web-app-samples-for-msal4j/pom.xml @@ -15,7 +15,7 @@ com.microsoft.azure msal4j - 0.4.0-preview + 0.5.0-preview com.nimbusds