小编zae*_*dam的帖子

尝试与 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
查看次数

Iss 声明无效 Keycloak

我使用 keycloak 服务登录我的网络应用程序。用作具有 oauth 2.0 安全性的后端 spring。当我使用从 keycloak 获得的不记名令牌向邮递员发出请求时,它给了我一个错误 401,并且在条目旁边的答案文本中www-Authenticate它告诉我:

Bearer error="invalid_token", error_description="An error occurred while attempting to decode the Jwt: The iss claim is not valid", error_uri="https://tools.ietf.org/html/rfc6750#section-3.1"

我该如何解决这个问题?

authentication spring jwt spring-boot keycloak

4
推荐指数
1
解决办法
1万
查看次数

为什么@FormParam 不支持 content=type=application/json?

我已经使用邮递员测试了一个 Rest API,在测试选择原始选项时,它显示了应用程序/json 标头内容类型不受支持的媒体,但仅适用于 url 编码形式。请具体说明如何使用@FormParamapplication/json内容类型。提前致谢。

java rest postman

2
推荐指数
1
解决办法
4169
查看次数

Angular 2 -POST 401 未经授权

我正在使用 Angular 2。我想使用 API 发布数据,但出现未经授权的访问错误...

有人可以帮我弄清楚为什么我会收到此错误吗?

401 未经授权

javascript api typescript angular

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