将密钥斗篷作为OIDC IDP

时间:2020-08-13 06:56:38

标签: oauth-2.0 keycloak openid-connect auth0

我有一个Keycloak服务器,我想为我的keycloak实例添加一个auth0连接作为IDP。

一切看起来都很不错,因为我被重定向到auth0页面并可以输入我的凭据,并且我返回到在keycloak中配置的keycloak URI,但是我在下面看到了一个异常,看来Keycloak正在获得302,但它没有没想到。

我在Keycloak的客户端上启用了隐式流。

我的Auth0 URL设置为:

  • http://.usauth0.com/authorize
  • http://.us.auth0.com/oauth/token
06:42:26,280 ERROR [org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider] (default task-28) Failed to make identity provider oauth callback: org.keycloak.broker.provider.IdentityBrokerException: Could not decode access token response.
    at org.keycloak.keycloak-services@7.0.1//org.keycloak.broker.oidc.OIDCIdentityProvider.getFederatedIdentity(OIDCIdentityProvider.java:348)
    at org.keycloak.keycloak-services@7.0.1//org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider$Endpoint.authResponse(AbstractOAuth2IdentityProvider.java:420)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.jboss.resteasy.resteasy-jaxrs@3.7.0.Final//org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:138)
    at org.jboss.resteasy.resteasy-jaxrs@3.7.0.Final//org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:517)
    at org.jboss.resteasy.resteasy-jaxrs@3.7.0.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:406)
    at org.jboss.resteasy.resteasy-jaxrs@3.7.0.Final//org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$0(ResourceMethodInvoker.java:370)
    at org.jboss.resteasy.resteasy-jaxrs@3.7.0.Final//org.jboss.resteasy.core.interception.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:355)
    at org.jboss.resteasy.resteasy-jaxrs@3.7.0.Final//org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:372
...

原因:

Caused by: com.fasterxml.jackson.core.JsonParseException: Unexpected character ('<' (code 60)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')
 at [Source: (String)"<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
"; line: 1, column: 2]

到目前为止,我唯一的想法是我的Keycloak回调URI不在https上,但我不知道一种验证此问题的方法。

我在Keycloak 7上

0 个答案:

没有答案