MCPcopy Index your code
hub / github.com/AzureAD/microsoft-authentication-library-for-java

github.com/AzureAD/microsoft-authentication-library-for-java @1.25.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.25.0 ↗ · + Follow
2,589 symbols 10,799 edges 352 files 527 documented · 20%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Microsoft Authentication Library (MSAL) for Java

Build Reference Docs
Build status MSAL Java reference

The Microsoft Authentication Library for Java (MSAL4J) enables applications to integrate with the Microsoft identity platform. 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 or your own APIs registered with the Microsoft identity platform. It is built using industry standard OAuth2 and OpenID Connect protocols.

Quick links:

Getting Started Home Samples Support Feedback

Install

The library supports the following Java environments: - Java 8 (or higher)

Current version - 1.25.0

You can find the changes for each version in the change log.

You can get the com.microsoft.aad.msal4j package through Maven or Gradle.

Maven

Find the latest package in the Maven repository.

<dependency>
    <groupId>com.microsoft.azure</groupId>
    <artifactId>msal4j</artifactId>
    <version>1.25.0</version>
</dependency>

Gradle

implementation group: 'com.microsoft.azure', name: 'com.microsoft.aad.msal4j', version: '1.25.0'

Usage

MSAL4J supports multiple application types and authentication scenarios.

Refer the Wiki pages for more details on the usage of MSAL Java and the supported scenarios.

Migrating from ADAL

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.

See the ADAL to MSAL migration guide.

Roadmap

You can follow the latest updates and plans for MSAL Java in the Roadmap published on our Wiki.

Contribution

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. 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. This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Samples and Documentation

We provide a full suite of sample applications and documentation to help you get started with learning the Microsoft identity platform.

Community Help and Support

We leverage Stack Overflow 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.

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

Submit Feedback

We'd like your thoughts on this library. Please complete this short survey.

Security Reporting

If you find a security issue with our libraries or services please report it to secure@microsoft.com with as much detail as possible. Your submission may be eligible for a bounty through the Microsoft Bounty 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 and subscribing to Security Advisory Alerts.

We Value and Adhere to the Microsoft Open Source Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Extension points exported contracts — how you extend this code

ICacheAccessor (Interface)
Interface for cache data access operations. [6 implementers]
msal4j-persistence-extension/src/main/java/com/microsoft/aad/msal4jextensions/persistence/ICacheAccessor.java
ITokenCacheAccessAspect (Interface)
Interface representing operation of executing code before and after cache access. This interface enables application [10 …
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ITokenCacheAccessAspect.java
IRunnableFactory (Interface)
(no doc) [12 implementers]
msal4j-persistence-extension/src/test/java/com/microsoft/aad/msal4jextensions/IRunnableFactory.java
IPublicClientApplication (Interface)
Interface representing a public client application (Desktop, Mobile). Public client application are not trusted to safel [6 …
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/IPublicClientApplication.java
ISecurityLibrary (Interface)
Interface which represents API for libsecret library on Linux. It is used for storing and retrieving passwords and other
msal4j-persistence-extension/src/main/java/com/microsoft/aad/msal4jextensions/persistence/linux/ISecurityLibrary.java
IHttpClient (Interface)
Interface to be implemented when configuring a custom HTTP client for IPublicClientApplication or {@link IConfid [7 implementers]
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/IHttpClient.java
ISecurityLibrary (Interface)
Interface which represents API for accessing KeyChain on Mac. It is used for storing and retrieving passwords and other
msal4j-persistence-extension/src/main/java/com/microsoft/aad/msal4jextensions/persistence/mac/ISecurityLibrary.java
IClientAssertion (Interface)
Credential type containing an assertion of type "urn:ietf:params:oauth:token-type:jwt". Client assertions provide a [5 …
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/IClientAssertion.java

Core symbols most depended-on inside this repo

get
called by 520
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AccountsSupplier.java
build
called by 399
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/PublicClientApplication.java
accessToken
called by 209
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/IAuthenticationResult.java
toString
called by 130
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/Prompt.java
authority
called by 119
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/IClientApplicationBase.java
getMessage
called by 116
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ManagedIdentityErrorResponse.java
isBlank
called by 103
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/StringHelper.java
acquireToken
called by 101
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ConfidentialClientApplication.java

Shape

Method 2,185
Class 355
Interface 31
Enum 18

Languages

Java100%

Modules by API surface

msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/ManagedIdentityTests.java55 symbols
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AbstractClientApplicationBase.java43 symbols
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AuthenticationResult.java40 symbols
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AuthorizationRequestUrlParameters.java38 symbols
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/InteractiveRequestParameters.java37 symbols
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/AbstractApplicationBase.java36 symbols
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/TokenCache.java34 symbols
msal4j-sdk/src/test/java/com/microsoft/aad/msal4j/UserFederatedIdentityCredentialTest.java27 symbols
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/SilentParameters.java26 symbols
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/ClientCredentialParameters.java26 symbols
msal4j-persistence-extension/src/main/java/com/microsoft/aad/msal4jextensions/PersistenceSettings.java26 symbols
msal4j-sdk/src/main/java/com/microsoft/aad/msal4j/UserFederatedIdentityCredentialParameters.java24 symbols

For agents

$ claude mcp add microsoft-authentication-library-for-java \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page