Skip to content

Commit d30509c

Browse files
committed
Merge branch 'avdunn/msalruntime-broker' of https://github.com/AzureAD/microsoft-authentication-library-for-java into avdunn/msalruntime-broker
# Conflicts: # msal4j-brokers/src/main/java/com/microsoft/aad/msal4jbrokers/Broker.java
2 parents 6fc2c6c + b551e70 commit d30509c

File tree

74 files changed

+1650
-3049
lines changed

Some content is hidden

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

74 files changed

+1650
-3049
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Feature request
2+
description: Suggest a new feature for MSAL Java
3+
labels: ["feature request", "untriaged", "needs attention"]
4+
title : '[Feature Request] '
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
## Before submitting your feature request
10+
Please make sure that your question or issue is not already covered in [MSAL documentation](https://learn.microsoft.com/entra/msal/java/) or [samples](https://learn.microsoft.com/azure/active-directory/develop/sample-v2-code?tabs=apptype).
11+
12+
- type: markdown
13+
attributes:
14+
value: |
15+
## Feature request for MSAL Java
16+
17+
- type: dropdown
18+
attributes:
19+
label: MSAL client type
20+
description: Are you using PublicClientApplication (desktop / CLI apps), ConfidentialClientApplication (web apps, web APIs, service-to-service) or ManagedIdentityApplication?
21+
multiple: true
22+
options:
23+
- "Public"
24+
- "Confidential"
25+
- "Managed identity"
26+
validations:
27+
required: true
28+
29+
- type: textarea
30+
attributes:
31+
label: Problem Statement
32+
description: "Describe the problem or context for this feature request."
33+
validations:
34+
required: true
35+
36+
- type: textarea
37+
attributes:
38+
label: Proposed solution
39+
description: "Describe the solution you'd like."
40+
validations:
41+
required: false
42+
43+
- type: textarea
44+
attributes:
45+
label: Alternatives
46+
description: "Describe alternatives you've considered."
47+
validations:
48+
required: false
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
name: Bug report
2+
description: Broken or unintended behavior with MSAL4J library
3+
title: '[Bug] '
4+
labels: ["untriaged", "needs attention"]
5+
body:
6+
- type: markdown
7+
attributes:
8+
value: |
9+
## Before submitting your issue
10+
Please make sure that your question or issue is not already covered in existing issues
11+
12+
**Logs and network traces**
13+
Without logs or traces, it is unlikely that the team can investigate your issue. Capturing logs is described in our [Docs](https://learn.microsoft.com/azure/active-directory/develop/msal-logging-java).
14+
15+
- type: markdown
16+
attributes:
17+
value: |
18+
## Issue details
19+
20+
- type: input
21+
attributes:
22+
label: Library version used
23+
description: "Enter the version of the library where you ran into the issue (e.g. 1.13.10)."
24+
validations:
25+
required: true
26+
27+
- type: input
28+
attributes:
29+
label: Java version
30+
description: "Enter the Java SDK and Framework version your application is developed in."
31+
validations:
32+
required: true
33+
34+
- type: dropdown
35+
attributes:
36+
label: Scenario
37+
description: "Are you using PublicClientApplication, ConfidentialClientApplication or ManagedIdentityApplication?"
38+
multiple: true
39+
options:
40+
- "PublicClient (AcquireTokenInteractive, AcquireTokenByUsernamePassword)"
41+
- "ConfidentialClient - web site (AcquireTokenByAuthCode)"
42+
- "ConfidentialClient - web api (AcquireTokenOnBehalfOf)"
43+
- "ConfidentialClient - service to service (AcquireTokenForClient)"
44+
- "ManagedIdentityClient - managed identity"
45+
- "Other - please specify"
46+
validations:
47+
required: true
48+
49+
- type: dropdown
50+
attributes:
51+
label: Is this a new or an existing app?
52+
description: "Is this a new or existing app?"
53+
multiple: false
54+
options:
55+
- "The app is in production, and I have upgraded to a new version of MSAL"
56+
- "The app is in production, I haven't upgraded MSAL, but started seeing this issue"
57+
- "This is a new app or experiment"
58+
validations:
59+
required: false
60+
61+
- type: textarea
62+
attributes:
63+
label: Issue description and reproduction steps
64+
description: "Briefly explain the issue you are seeing along with any error messages or stack trace. Provide a link to one of the [standard samples](https://learn.microsoft.com/azure/active-directory/develop/sample-v2-code?tabs=apptype) and steps to reproduce the behavior. Make sure to provide verbose level log messages from MSAL, if available. [Learn more](https://learn.microsoft.com/azure/active-directory/develop/msal-logging-dotnet)"
65+
validations:
66+
required: true
67+
68+
- type: textarea
69+
attributes:
70+
label: Relevant code snippets
71+
description: "Provide relevant code snippets that can be used to reproduce the issue."
72+
render: csharp
73+
validations:
74+
required: false
75+
76+
- type: textarea
77+
attributes:
78+
label: Expected behavior
79+
description: "Describe what you expect the behavior to be."
80+
validations:
81+
required: false
82+
83+
- type: dropdown
84+
attributes:
85+
label: Identity provider
86+
options:
87+
- Microsoft Entra ID (Work and School accounts and Personal Microsoft accounts)
88+
- Azure B2C Basic Policy
89+
- Azure B2C Custom Policy
90+
- Azure Active Directory Federation Services (ADFS)
91+
- Microsoft Entra External ID
92+
- Other
93+
validations:
94+
required: true
95+
96+
- type: input
97+
attributes:
98+
label: Regression
99+
description: "If this behavior worked before, enter the last working version(s) of MSAL."
100+
placeholder: "MSAL version: "
101+
102+
- type: textarea
103+
attributes:
104+
label: Solution and workarounds
105+
description: "Possible solution or workarounds, if you know of any."
106+
validations:
107+
required: false
108+
109+
- type: markdown
110+
attributes:
111+
value: "## Security Reporting"
112+
- type: markdown
113+
attributes:
114+
value: |
115+
If you find a security issue with our libraries or services [please report it to the Microsoft Security Response Center (MSRC)](https://aka.ms/report-security-issue) with as much detail as possible. Your submission may be eligible for a bounty through the [Microsoft Bounty](http://aka.ms/bugbounty) program. Please do not post security issues to GitHub Issues or any other public site. We will contact you shortly upon receiving the information. We encourage you to get notifications of when security incidents occur by visiting [this page](https://www.microsoft.com/msrc/technical-security-notifications) and subscribing to Security Advisory Alerts.

.github/workflows/codeql.yml

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

Contributing.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# CONTRIBUTING
2+
3+
Microsoft Authentication Library for Java welcomes new contributors. This document will guide you
4+
through the process.
5+
6+
## CONTRIBUTOR LICENSE AGREEMENT
7+
8+
Please visit [https://cla.microsoft.com/](https://cla.microsoft.com/) and sign the Contributor License
9+
Agreement. You only need to do that once. We can not look at your code until you've submitted this request.
10+
11+
12+
## Build
13+
14+
Use Java8.
15+
16+
## Test
17+
18+
Unit tests should run as expected. Integration tests require certificate / secrets which are deployed on CI. External contributors are not able to run integration tests manually.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Quick links:
1616
The library supports the following Java environments:
1717
- Java 8 (or higher)
1818

19-
Current version - 1.13.8
19+
Current version - 1.13.11
2020

2121
You can find the changes for each version in the [change log](https://github.com/AzureAD/microsoft-authentication-library-for-java/blob/main/msal4j-sdk/changelog.txt).
2222

@@ -28,13 +28,13 @@ Find [the latest package in the Maven repository](https://mvnrepository.com/arti
2828
<dependency>
2929
<groupId>com.microsoft.azure</groupId>
3030
<artifactId>msal4j</artifactId>
31-
<version>1.13.8</version>
31+
<version>1.13.11</version>
3232
</dependency>
3333
```
3434
### Gradle
3535

3636
```gradle
37-
implementation group: 'com.microsoft.azure', name: 'com.microsoft.aad.msal4j', version: '1.13.8'
37+
implementation group: 'com.microsoft.azure', name: 'com.microsoft.aad.msal4j', version: '1.13.11'
3838
```
3939

4040
## Usage

msal4j-sdk/changelog.txt renamed to changelog.txt

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Version 1.14.1-beta
1+
Version 1.14.3-beta
22
=============
33
- Add proof-of-possession token support
44
- Add MSALRuntime logging support
@@ -8,6 +8,22 @@ Version 1.14.0-beta
88
- Add IBroker interface
99
- Add app-level parameter for enabling the use of auth brokers
1010

11+
Version 1.13.11
12+
=============
13+
- Hotfix for internal docs generation issue (#705)
14+
15+
Version 1.13.10
16+
=============
17+
- Remove default HTTP timeout (#664)
18+
- Add equals/hash logic to Account class based on homeAccountID (#681)
19+
- Fix issue with command to open default browser on Linux (#683)
20+
- Handle null pointer exception in certain ADFS scenarios (#669)
21+
22+
Version 1.13.9
23+
=============
24+
- Update automated tests to use JUnit 5/Mockito instead of TestNG/Powermock
25+
- Fix issue with interactive flow on macOS/Linux/Unix systems
26+
1127
Version 1.13.8
1228
=============
1329
- Added support for CIAM authority

msal4j-brokers/pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>com.microsoft.azure</groupId>
77
<artifactId>msal4j-brokers</artifactId>
8-
<version>1.0.2-beta</version>
8+
<version>1.0.3-beta</version>
99
<packaging>jar</packaging>
1010
<name>msal4j-brokers</name>
1111
<description>
@@ -34,12 +34,12 @@
3434
<dependency>
3535
<groupId>com.microsoft.azure</groupId>
3636
<artifactId>msal4j</artifactId>
37-
<version>1.14.1-beta</version>
37+
<version>1.14.3-beta</version>
3838
</dependency>
3939
<dependency>
4040
<groupId>com.microsoft.azure</groupId>
4141
<artifactId>javamsalruntime</artifactId>
42-
<version>0.13.8</version>
42+
<version>0.13.10</version>
4343
</dependency>
4444
<dependency>
4545
<groupId>org.projectlombok</groupId>

msal4j-brokers/src/main/java/com/microsoft/aad/msal4jbrokers/MsalRuntimeBroker.java renamed to msal4j-brokers/src/main/java/com/microsoft/aad/msal4jbrokers/Broker.java

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,14 @@
1717
import java.util.concurrent.CompletableFuture;
1818
import java.util.concurrent.ExecutionException;
1919

20-
public class MsalRuntimeBroker implements IBroker {
21-
private static final Logger LOG = LoggerFactory.getLogger(MsalRuntimeBroker.class);
20+
public class Broker implements IBroker {
21+
private static final Logger LOG = LoggerFactory.getLogger(Broker.class);
2222

2323
private static MsalRuntimeInterop interop;
2424
private static Boolean brokerAvailable;
2525

26+
private boolean supportWindows;
27+
2628
static {
2729
try {
2830
//MsalRuntimeInterop performs various initialization steps in a similar static block,
@@ -107,7 +109,7 @@ public CompletableFuture<IAuthenticationResult> acquireToken(PublicClientApplica
107109
parameters.proofOfPossession().getUri(),
108110
parameters.proofOfPossession().getNonce());
109111
}
110-
112+
111113
AuthParameters authParameters = authParamsBuilder.build();
112114

113115
return interop.signInInteractively(parameters.windowHandle(), authParameters, correlationID, parameters.loginHint())
@@ -246,4 +248,33 @@ public void enableBrokerPIILogging(boolean enablePII) {
246248
private String generateCorrelationID() {
247249
return UUID.randomUUID().toString();
248250
}
251+
252+
public static class Builder {
253+
private boolean supportWindows = false;
254+
255+
public Builder() {
256+
}
257+
258+
/**
259+
* When set to true, MSAL Java will attempt to use the broker when the application is running on a Windows OS
260+
*/
261+
public Builder supportWindows(boolean val) {
262+
supportWindows = val;
263+
return this;
264+
}
265+
266+
public Broker build() {
267+
return new Broker(this);
268+
}
269+
}
270+
271+
private Broker(Builder builder) {
272+
this.supportWindows = builder.supportWindows;
273+
274+
//This will be expanded to cover other OS options, but for now it is only Windows. Since Windows is the only
275+
// option, if app developer doesn't want to use the broker on Windows then they shouldn't use the Broker at all
276+
if (!this.supportWindows) {
277+
throw new MsalClientException("At least one operating system support option must be used when building the Broker instance", AuthenticationErrorCode.MSALJAVA_BROKERS_ERROR);
278+
}
279+
}
249280
}

0 commit comments

Comments
 (0)