Skip to content

Commit 41018ef

Browse files
committed
Merge branch 'dev' into main
# Conflicts: # README.md # msal4j-sdk/changelog.txt # msal4j-sdk/src/integrationtest/java/com.microsoft.aad.msal4j/ClientCredentialsIT.java # msal4j-sdk/src/integrationtest/java/com.microsoft.aad.msal4j/TestConstants.java # msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AadInstanceDiscoveryProvider.java # msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AbstractClientApplicationBase.java # msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/TokenRequestExecutor.java # msal4j-sdk/src/samples/msal-b2c-web-sample/pom.xml # msal4j-sdk/src/samples/msal-obo-sample/pom.xml # msal4j-sdk/src/samples/msal-web-sample/pom.xml # pom.xml
2 parents 9140de8 + 32c5751 commit 41018ef

File tree

342 files changed

+1833
-599
lines changed

Some content is hidden

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

342 files changed

+1833
-599
lines changed

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ jobs:
2121

2222
# Initializes the CodeQL tools for scanning.
2323
- name: Initialize CodeQL
24-
uses: github/codeql-action/init@v1
24+
uses: github/codeql-action/init@v2
2525
# Override language selection by uncommenting this and choosing your languages
2626
# with:
2727
# languages: go, javascript, csharp, python, cpp, java
2828

2929
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
3030
# If this step fails, then you should remove it and run the build manually (see below).
3131
- name: Autobuild
32-
uses: github/codeql-action/autobuild@v1
32+
uses: github/codeql-action/autobuild@v2
3333

3434
# ℹ️ Command-line programs to run using the OS shell.
3535
# 📚 https://git.io/JvXDl
@@ -43,4 +43,4 @@ jobs:
4343
# make release
4444

4545
- name: Perform CodeQL Analysis
46-
uses: github/codeql-action/analyze@v1
46+
uses: github/codeql-action/analyze@v2

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
`main` branch | `dev` branch | Reference Docs
44
--------------------|-----------------|---------------
5-
[![Build status](https://identitydivision.visualstudio.com/IDDP/_apis/build/status/CI/Java/MSAL%20Java%20CI%20Build?branchName=main)](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)
5+
[![Build status](https://identitydivision.visualstudio.com/IDDP/_apis/build/status/CI/Java/MSAL%20Java%20CI%20Build?branchName=main)](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)| [MSAL Java reference](https://learn.microsoft.com/en-us/java/api/com.microsoft.aad.msal4j?view=msal-java-latest)
66

77
The Microsoft Authentication Library for Java (MSAL4J) enables applications to integrate with the [Microsoft identity platform](https://docs.microsoft.com/en-us/azure/active-directory/develop/). It allows you to sign in users or apps with Microsoft identities (Azure AD, Microsoft accounts and Azure AD B2C accounts) and obtain tokens to call Microsoft APIs such as [Microsoft Graph](https://graph.microsoft.io/) or your own APIs registered with the Microsoft identity platform. It is built using industry standard OAuth2 and OpenID Connect protocols.
88

@@ -16,25 +16,25 @@ Quick links:
1616
The library supports the following Java environments:
1717
- Java 8 (or higher)
1818

19-
Current version - 1.13.1
19+
Current version - 1.13.8
2020

2121
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).
2222

23-
You can get the msal4j package through Maven or Gradle.
23+
You can get the com.microsoft.aad.msal4j package through Maven or Gradle.
2424

2525
### Maven
2626
Find [the latest package in the Maven repository](https://mvnrepository.com/artifact/com.microsoft.azure/msal4j).
2727
```xml
2828
<dependency>
2929
<groupId>com.microsoft.azure</groupId>
3030
<artifactId>msal4j</artifactId>
31-
<version>1.13.1</version>
31+
<version>1.13.8</version>
3232
</dependency>
3333
```
3434
### Gradle
3535

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

4040
## Usage

.gitignore renamed to msal4j-brokers/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*.rar
2121

2222
# Intellij
23-
.idea/
23+
../.idea/
2424

2525
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2626
hs_err_pid*

msal4j-brokers/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#Microsoft Authentication Library Brokers
2+
### Maven
3+
Find [the latest package in the Maven repository](https://mvnrepository.com/artifact/com.microsoft.azure/msal4j-brokers).
4+
```xml
5+
<dependency>
6+
<groupId>com.microsoft.azure</groupId>
7+
<artifactId>msal4j-brokers</artifactId>
8+
<version>0.0.1</version>
9+
</dependency>
10+
```
11+
### Gradle
12+
13+
```gradle
14+
implementation group: 'com.microsoft.azure', name: 'msal4j-brokers', version: '0.0.1'
15+
```

msal4j-brokers/pom.xml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project xmlns="http://maven.apache.org/POM/4.0.0"
3+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
5+
<modelVersion>4.0.0</modelVersion>
6+
<groupId>com.microsoft.azure</groupId>
7+
<artifactId>msal4j-brokers</artifactId>
8+
<version>0.0.1</version>
9+
<packaging>jar</packaging>
10+
<name>msal4j-brokers</name>
11+
<description>
12+
Microsoft Authentication Library for Java - Brokers helps you integrate with the broker
13+
on windows machine to secure Access tokens and refresh tokens.
14+
</description>
15+
<url>https://github.com/AzureAD/microsoft-authentication-library-for-java</url>
16+
<licenses>
17+
<license>
18+
<name>MIT License</name>
19+
</license>
20+
</licenses>
21+
<inceptionYear>2022</inceptionYear>
22+
<scm>
23+
<url>https://github.com/AzureAD/microsoft-authentication-library-for-java</url>
24+
</scm>
25+
<properties>
26+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
27+
</properties>
28+
<dependencies>
29+
<!-- https://mvnrepository.com/artifact/com.microsoft.azure/msal4j -->
30+
<dependency>
31+
<groupId>com.microsoft.azure</groupId>
32+
<artifactId>msal4j</artifactId>
33+
<version>1.13.2</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>org.projectlombok</groupId>
37+
<artifactId>lombok</artifactId>
38+
<version>1.18.6</version>
39+
<scope>provided</scope>
40+
</dependency>
41+
</dependencies>
42+
43+
<!-- force https -->
44+
<repositories>
45+
<repository>
46+
<id>central</id>
47+
<url>https://repo1.maven.org/maven2</url>
48+
<snapshots>
49+
<enabled>false</enabled>
50+
</snapshots>
51+
</repository>
52+
</repositories>
53+
<pluginRepositories>
54+
<pluginRepository>
55+
<id>central</id>
56+
<url>https://repo1.maven.org/maven2</url>
57+
<snapshots>
58+
<enabled>false</enabled>
59+
</snapshots>
60+
</pluginRepository>
61+
</pluginRepositories>
62+
<build>
63+
<sourceDirectory>${project.build.directory}/delombok</sourceDirectory>
64+
<plugins>
65+
<plugin>
66+
<groupId>org.projectlombok</groupId>
67+
<artifactId>lombok-maven-plugin</artifactId>
68+
<version>1.18.2.0</version>
69+
<executions>
70+
<execution>
71+
<goals>
72+
<goal>delombok</goal>
73+
</goals>
74+
</execution>
75+
</executions>
76+
<configuration>
77+
<sourceDirectory>src/main/java</sourceDirectory>
78+
<outputDirectory>${project.build.directory}/delombok</outputDirectory>
79+
<addOutputDirectory>false</addOutputDirectory>
80+
</configuration>
81+
</plugin>
82+
<plugin>
83+
<groupId>org.apache.maven.plugins</groupId>
84+
<artifactId>maven-surefire-plugin</artifactId>
85+
<version>2.10</version>
86+
<configuration>
87+
<argLine>-noverify</argLine>
88+
</configuration>
89+
</plugin>
90+
<plugin>
91+
<groupId>org.apache.maven.plugins</groupId>
92+
<artifactId>maven-javadoc-plugin</artifactId>
93+
<version>3.1.0</version>
94+
<configuration>
95+
<sourcepath>${project.build.directory}/delombok</sourcepath>
96+
</configuration>
97+
<executions>
98+
<execution>
99+
<id>attach-javadocs</id>
100+
<goals>
101+
<goal>jar</goal>
102+
</goals>
103+
</execution>
104+
</executions>
105+
</plugin>
106+
<plugin>
107+
<groupId>org.apache.maven.plugins</groupId>
108+
<artifactId>maven-source-plugin</artifactId>
109+
<version>2.2.1</version>
110+
<executions>
111+
<execution>
112+
<id>attach-sources</id>
113+
<goals>
114+
<goal>jar</goal>
115+
</goals>
116+
</execution>
117+
</executions>
118+
</plugin>
119+
<plugin>
120+
<groupId>org.apache.maven.plugins</groupId>
121+
<artifactId>maven-compiler-plugin</artifactId>
122+
<version>3.7.0</version>
123+
<configuration>
124+
<source>8</source>
125+
<target>8</target>
126+
</configuration>
127+
</plugin>
128+
</plugins>
129+
</build>
130+
131+
</project>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
package com.microsoft.aad.msal4jbrokers;
2+
3+
import com.microsoft.aad.msal4j.*;
4+
import lombok.extern.slf4j.Slf4j;
5+
6+
import java.util.concurrent.CompletableFuture;
7+
8+
@Slf4j
9+
public class MSALRuntimeBroker implements IBroker {
10+
11+
@Override
12+
public IAuthenticationResult acquireToken(PublicClientApplication application, SilentParameters requestParameters) {
13+
log.debug("Should not call this API if msal runtime init failed");
14+
throw new MsalClientException("Broker implementation missing", "missing_broker");
15+
}
16+
17+
@Override
18+
public IAuthenticationResult acquireToken(PublicClientApplication application, InteractiveRequestParameters requestParameters) {
19+
throw new MsalClientException("Broker implementation missing", "missing_broker");
20+
}
21+
22+
@Override
23+
public IAuthenticationResult acquireToken(PublicClientApplication application, UserNamePasswordParameters requestParameters) {
24+
throw new MsalClientException("Broker implementation missing", "missing_broker");
25+
}
26+
27+
@Override
28+
public CompletableFuture removeAccount(IAccount account) {
29+
throw new MsalClientException("Broker implementation missing", "missing_broker");
30+
}
31+
}

msal4j-sdk/.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Compiled class file
2+
*.class
3+
4+
# Log file
5+
*.log
6+
7+
# BlueJ files
8+
*.ctxt
9+
10+
# Mobile Tools for Java (J2ME)
11+
.mtj.tmp/
12+
13+
# Package Files #
14+
*.jar
15+
*.war
16+
*.nar
17+
*.ear
18+
*.zip
19+
*.tar.gz
20+
*.rar
21+
22+
# Intellij
23+
../.idea/
24+
25+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
26+
hs_err_pid*
27+
28+
# Lombok
29+
target/*

msal4j-sdk/README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Microsoft Authentication Library (MSAL) for Java
2+
3+
`main` branch | `dev` branch | Reference Docs
4+
--------------------|-----------------|---------------
5+
[![Build status](https://identitydivision.visualstudio.com/IDDP/_apis/build/status/CI/Java/MSAL%20Java%20CI%20Build?branchName=main)](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/com.microsoft.aad.msal4j.svg)](http://javadoc.io/doc/com.microsoft.azure/com.microsoft.aad.msal4j)
6+
7+
The Microsoft Authentication Library for Java (MSAL4J) enables applications to integrate with the [Microsoft identity platform](https://docs.microsoft.com/en-us/azure/active-directory/develop/). It allows you to sign in users or apps with Microsoft identities (Azure AD, Microsoft accounts and Azure AD B2C accounts) and obtain tokens to call Microsoft APIs such as [Microsoft Graph](https://graph.microsoft.io/) or your own APIs registered with the Microsoft identity platform. It is built using industry standard OAuth2 and OpenID Connect protocols.
8+
9+
Quick links:
10+
11+
| [Getting Started](https://docs.microsoft.com/en-us/azure/active-directory/develop/web-app-quickstart?pivots=devlang-java) | [Home](https://github.com/AzureAD/microsoft-authentication-library-for-java/wiki) | [Samples](https://github.com/Azure-Samples/ms-identity-msal-java-samples) | [Support](README.md#community-help-and-support) | [Feedback](https://forms.office.com/r/6AhHwQp3pe)
12+
| --- | --- | --- | --- | --- |
13+
14+
## Install
15+
16+
The library supports the following Java environments:
17+
- Java 8 (or higher)
18+
19+
Current version - 1.13.8
20+
21+
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).
22+
23+
You can get the com.microsoft.aad.msal4j package through Maven or Gradle.
24+
25+
### Maven
26+
Find [the latest package in the Maven repository](https://mvnrepository.com/artifact/com.microsoft.azure/com.microsoft.aad.msal4j).
27+
```xml
28+
<dependency>
29+
<groupId>com.microsoft.azure</groupId>
30+
<artifactId>msal4j</artifactId>
31+
<version>1.13.8</version>
32+
</dependency>
33+
```
34+
### Gradle
35+
36+
```gradle
37+
compile group: 'com.microsoft.azure', name: 'msal4j', version: '1.13.8'
38+
```
39+
40+
## Usage
41+
42+
MSAL4J supports multiple [application types and authentication scenarios](https://docs.microsoft.com/azure/active-directory/develop/authentication-flows-app-scenarios).
43+
44+
Refer the [Uncyclo](https://github.com/AzureAD/microsoft-authentication-library-for-java/wiki) pages for more details on the usage of MSAL Java and the supported scenarios.
45+
46+
## Migrating from ADAL
47+
If your application is using ADAL for Java (ADAL4J), we recommend you to update to use MSAL4J. No new feature work will be done in ADAL4J.
48+
49+
See the [ADAL to MSAL migration](https://github.com/AzureAD/microsoft-authentication-library-for-java/wiki/Migrate-to-MSAL-Java) guide.
50+
51+
## Roadmap
52+
53+
You can follow the latest updates and plans for MSAL Java in the [Roadmap](https://github.com/AzureAD/microsoft-authentication-library-for-java/wiki#roadmap) published on our Uncyclo.
54+
55+
## Contribution
56+
57+
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
58+
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
59+
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.
60+
61+
## Samples and Documentation
62+
63+
We provide a [full suite of sample applications](https://aka.ms/aaddevsamplesv2) and [documentation](https://docs.microsoft.com/en-us/azure/active-directory/develop/) to help you get started with learning the Microsoft identity platform.
64+
65+
## Community Help and Support
66+
67+
We leverage [Stack Overflow](http://stackoverflow.com/) to work with the community on supporting Azure Active Directory and its SDKs, including this one! We highly recommend you ask your questions on Stack Overflow (we're all on there!) Also browser existing issues to see if someone has had your question before.
68+
69+
We recommend you use the "msal" tag so we can see it! Here is the latest Q&A on Stack Overflow for MSAL: [http://stackoverflow.com/questions/tagged/msal](http://stackoverflow.com/questions/tagged/msal)
70+
71+
## Submit Feedback
72+
We'd like your thoughts on this library. Please complete [this short survey.](https://forms.office.com/r/6AhHwQp3pe)
73+
74+
## Security Reporting
75+
76+
If you find a security issue with our libraries or services please report it to [[email protected]](mailto:[email protected]) 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://technet.microsoft.com/security/dd252948) and subscribing to Security Advisory Alerts.
77+
78+
## We Value and Adhere to the Microsoft Open Source Code of Conduct
79+
80+
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 [[email protected]](mailto:[email protected]) with any additional questions or comments.

msal4j-sdk/bnd.bnd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Export-Package: com.microsoft.aad.msal4j;version="1.13.8"
2+
Automatic-Module-Name: com.microsoft.aad.msal4j

0 commit comments

Comments
 (0)