-
Notifications
You must be signed in to change notification settings - Fork 155
Support new CIAM authority #626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7866c0e
Initial commit
siddhijain a9d2ff7
add CIAM authority file
siddhijain 8737dcf
revert authority validation changes
siddhijain 883d2fb
Fix failing tests
siddhijain 90adcfa
Fix failing tests
siddhijain 7d10779
remove commented out line
siddhijain 56ec57d
remove unnecessary code
siddhijain 9d4e1dd
update exception message for device code flow
siddhijain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| import labapi.AppCredentialProvider; | ||
| import labapi.AzureEnvironment; | ||
| import labapi.LabUserProvider; | ||
| import labapi.User; | ||
| import org.testng.Assert; | ||
| import org.testng.annotations.BeforeClass; | ||
| import org.testng.annotations.DataProvider; | ||
|
|
@@ -18,6 +19,8 @@ | |
| import java.security.UnrecoverableKeyException; | ||
| import java.security.cert.CertificateException; | ||
| import java.util.Collections; | ||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
| import java.util.concurrent.Callable; | ||
|
|
||
| import static com.microsoft.aad.msal4j.TestConstants.KEYVAULT_DEFAULT_SCOPE; | ||
|
|
@@ -62,11 +65,29 @@ public void acquireTokenClientCredentials_ClientAssertion() throws Exception { | |
|
|
||
| @Test | ||
| public void acquireTokenClientCredentials_ClientSecret_Ciam() throws Exception { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CC @trwalke for E2E test with client_credentials. |
||
| String clientId = labUserProvider.getCiamUser().getAppId(); | ||
|
|
||
| User user = labUserProvider.getCiamUser(); | ||
| String clientId = user.getAppId(); | ||
|
|
||
| Map<String, String> extraQueryParameters = new HashMap<>(); | ||
| extraQueryParameters.put("dc","ESTS-PUB-EUS-AZ1-FD000-TEST1"); | ||
|
|
||
| AppCredentialProvider appProvider = new AppCredentialProvider(AzureEnvironment.CIAM); | ||
| IClientCredential credential = ClientCredentialFactory.createFromSecret(appProvider.getOboAppPassword()); | ||
|
|
||
| ConfidentialClientApplication cca = ConfidentialClientApplication.builder( | ||
| clientId, credential). | ||
| authority("https://" + user.getLabName() + ".ciamlogin.com/"). | ||
| build(); | ||
|
|
||
| IAuthenticationResult result = cca.acquireToken(ClientCredentialParameters | ||
| .builder(Collections.singleton(TestConstants.GRAPH_DEFAULT_SCOPE)) | ||
| .extraQueryParameters(extraQueryParameters) | ||
| .build()) | ||
| .get(); | ||
|
|
||
| Assert.assertNotNull(result); | ||
| Assert.assertNotNull(result.accessToken()); | ||
| assertAcquireTokenCommon(clientId, credential, TestConstants.CIAM_AUTHORITY); | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,5 +4,5 @@ | |
| package com.microsoft.aad.msal4j; | ||
|
|
||
| enum AuthorityType { | ||
| AAD, ADFS, B2C | ||
| AAD, ADFS, B2C, CIAM | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.