we have installed keycloak as standalone on the server and have registered it as adapter on the same server by wildfly. So, after registration by Identity Broker with OpenId (is self written and is deployed on the other domain) we will be not redirected back to our application, but we get next error: "Failed to make identity provider oath callback: "Token is no longer valid". It works next: DNS:8080(8443)/app.war (server wildfly)-> (makes a redirection to keycloak on) DNS:8180(8543)/auth -> (after choosing open-id provider we will successful redirected to it and we'll be logged in the system after entering name and password) -> (Error) Instead of to be redirected to our app back we get an Exception.
We have tried also Google Auth to test, whether server works properly and yes, it does. But also our Identity Broker works properly with localhost. What it could be?
I appreciate any help and will provide you with any snippet of code, you need.
Keycloak 1.9.4.Final, Wildfly 8.2.1.Final
Code:
wildfly, standalone-full.xml:
<subsystem xmlns="urn:jboss:domain:keycloak:1.1">
<secure-deployment name="jbpm-console.war">
<realm>nameOfRealm</realm>
<resource>nameOfClient</resource>
<enable-basic-auth>true</enable-basic-auth>
<realm-public-key>myPublicKey</realm-public-key>
<auth-server-url>myUrl</auth-server-url>
<ssl-required>none</ssl-required>
<principal-attribute>preferred_username</principal-attribute>
<credential name="secret">mysecret</credential>
</secure-deployment>
</subsystem>
<interfaces>
<interface name="management">
<inet-address value="${jboss.bind.address.management:0.0.0.0}"/>
</interface>
<interface name="public">
<inet-address value="${jboss.bind.address:0.0.0.0}"/>
</interface>
<interface name="unsecure">
<inet-address value="${jboss.bind.address.unsecure:127.0.0.1}"/>
</interface>
</interfaces>
<subsystem xmlns="urn:jboss:domain:undertow:1.2">
<buffer-cache name="default"/>
<server name="default-server">
<http-listener name="default" socket-binding="http"/>
<host name="default-host" alias="localhost">
<location name="/" handler="welcome-content"/>
<filter-ref name="server-header"/>
<filter-ref name="x-powered-by-header"/>
<single-sign-on path="/"/>
</host>
</server>
23:33:18,529 ERROR [org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider] (default task-5) Failed to make identity provider oauth callback: org.keycloak.broker.provider.IdentityBrokerException: Token is no longer valid
at org.keycloak.broker.oidc.OIDCIdentityProvider.validateToken(OIDCIdentityProvider.java:346)
at org.keycloak.broker.oidc.OIDCIdentityProvider.getFederatedIdentity(OIDCIdentityProvider.java:254)
at org.keycloak.broker.oidc.AbstractOAuth2IdentityProvider$Endpoint.authResponse(AbstractOAuth2IdentityProvider.java:230)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)