Skip to content

[BUG] Active Directory starter 6.1.0 ClassNotFoundException: com.nimbusds.oauth2.sdk.util.StringUtils #47600

Closed

Description

@dnijssen

Describe the bug
Between Spring Cloud Azure Dependencies 6.0.0 -> 6.1.0 we stumbled upon a ClassNotFoundException: com.nimbusds.oauth2.sdk.util.StringUtils

Exception or Stack Trace

Caused by: java.lang.NoClassDefFoundError: com/nimbusds/oauth2/sdk/util/StringUtils
	at com.azure.spring.cloud.autoconfigure.implementation.aad.security.properties.AadAuthorizationServerEndpoints.<init>

Additional context
We just have a simple Spring Boot project at our side, with the following Security related dependencies;

implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-oauth2-resource-server")
implementation("com.azure.spring:spring-cloud-azure-starter-active-directory")

Works with Spring Boot 3.5.9 and Spring Azure Cloud Depenencies 6.0.0, but when upgrading to Spring Azure Cloud Dependencies 6.1.0 it breaks

Activity

  1. added
    azure-springAll azure-spring related issues
    ClientThis issue points to a problem in the data-plane of the library.
    customer-reportedIssues that are reported by GitHub users external to the Azure organization.
    needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK team
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    on Dec 24, 2025
  2. github-actions commented on Dec 24, 2025

    @github-actions
    Contributor

    Thank you for your feedback. Tagging and routing to the team member best able to assist.

  3. rujche commented on Dec 25, 2025

    @rujche
    Contributor

    Hi, dnijssen. Thank for reaching out.

    1. Root cause analysis.

    1. The com.nimbusds.oauth2.sdk.util.StringUtils was in this artifact: oauth2-oidc-sdk

      Image
    2. When use 6.0.0, the dependency is added by azure-identity -> masl4j -> oauth2-oidc-sdk. The path from spring-security-oauth2-client won't take effect because it's optional and your project didn't have this dependency.

      Image Image
    3. When use 6.1.0, the dependency path from azure-identity is missting.

      Image

    2. Workaround

    You can do like this as workaround: Adding this dependency in your project:

    implementation("com.nimbusds:oauth2-oidc-sdk:9.43.6")

    3. Fix in Spring Cloud Azure side

    Use StringUtils from spring-core instead. In a spring-boot project, it will always contains spring-core dependency.

    Image

    PR is coming soon. The diff will be like this:

    $ git diff
    diff --git a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/properties/AadAuthorizationServerEndpoints.java b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/properties/AadAuthorizationServerEndpoints.java
    index ca5c53af3e4..fd098c6d738 100644
    --- a/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/properties/AadAuthorizationServerEndpoints.java
    +++ b/sdk/spring/spring-cloud-azure-autoconfigure/src/main/java/com/azure/spring/cloud/autoconfigure/implementation/aad/security/properties/AadAuthorizationServerEndpoints.java
    @@ -3,7 +3,8 @@
     
     package com.azure.spring.cloud.autoconfigure.implementation.aad.security.properties;
     
    -import com.nimbusds.oauth2.sdk.util.StringUtils;
    +
    +import org.springframework.util.StringUtils;
     
     /**
      * Used to get endpoints for Microsoft Identity authorization server.
    @@ -27,7 +28,7 @@ public class AadAuthorizationServerEndpoints {
          * @param tenantId the tenant ID
          */
         public AadAuthorizationServerEndpoints(String baseUri, String tenantId) {
    -        if (StringUtils.isBlank(baseUri)) {
    +        if (!StringUtils.hasText(baseUri)) {
                 baseUri = DEFAULT_BASE_URI;
             }
             this.baseUri = addSlash(baseUri);

    @copilot, create the PR according to above diff.

  4. added a commit that references this issue on Dec 25, 2025
  5. dnijssen commented on Jan 6, 2026

    @dnijssen
    Author

    Rujun Chen (@rujche) Will the fix be included in 7.0.0 as well? Because it is currently missing in 7.0.0-beta.1

  6. rujche commented on Jan 7, 2026

    @rujche
    Contributor

    @rujche Will the fix be included in 7.0.0 as well? Because it is currently missing in 7.0.0-beta.1

    dnijssen Yes, it will be fixed in 7.0.0.

  7. added this to the 2026-01 milestone on Jan 21, 2026
  8. locked and limited conversation to collaborators on Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.azure-springAll azure-spring related issuescustomer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionWorkflow: This issue needs attention from Azure service team or SDK teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions