小编Rah*_*i07的帖子

尝试与 azure AuthenticationResult 连接,但出现错误 java.lang.NoClassDefFoundError: com/nimbusds/jwt/JWTParser

尝试通过休息服务调用与 azure AuthenticationResult 连接,但收到错误消息

{“代码”:500,“消息”:“java.lang.NoClassDefFoundError:com / nimbusds / jwt / JWTParser”}

private static AuthenticationResult getAccessTokenFromUserCredentials(String username, String password)
        throws Exception {
    AuthenticationContext context;
    AuthenticationResult result;
    ExecutorService service = null;
    try {
        service = Executors.newFixedThreadPool(1);
        context = new AuthenticationContext(AUTHORITY, false, service);
        Future<AuthenticationResult> future = context.acquireToken("https://graph.microsoft.com", CLIENT_ID, username, password, null);

        result = future.get();
    } finally {
        service.shutdown();
    }

    if (result == null) {
        throw new ServiceUnavailableException("authentication result was null");
    }
    return result;
}
Run Code Online (Sandbox Code Playgroud)

java azure spring-boot

5
推荐指数
1
解决办法
9384
查看次数

标签 统计

azure ×1

java ×1

spring-boot ×1