RE: Liferay Keycloak login Internal Server Error

Jamie Sammons, modified 1 Year ago. New Member Posts: 2 Join Date: 4/2/24 Recent Posts

Hi!

I have a CE Liferay Portal, and the following error message pops up when I login in Keycloak:

Error:Internal Server Error

An error occurred while accessing the requested resource.

https://dev.footballbenchmark.com/c/portal/login/openidconnect?state=jwM1SCKl-gjXca9L3nnJiu2heVMJOjR_XM4slqCf414&code=720aa559-aef0-4a17-91e2-b5c904c635a0.306139b4-aa7d-4e8c-a454-2641724300b9.9a378ad6-4b6a-4f98-adb8-1cedf1cff894

I use a Docker Image of the Liferay Portal.
Can someone help me with this?

 

Thanks,
Mark

thumbnail
Olaf Kock, modified 1 Year ago. Liferay Legend Posts: 6441 Join Date: 9/23/08 Recent Posts

Pardon me - Given the level of details you provide (e.g.: zero), "works for me" would be an appropriate answer.

Exact versions, your configuration steps on both sides of the equation, error logs - all are missing. Please give as much detail as possible (not limited to the points that I've listed):

This free support depends on the proper details being provided in the question.

David H Nebinger, modified 1 Year ago. New Member Posts: 2 Join Date: 4/2/24 Recent Posts

The Liferay are running in:

  • docker.elastic.co/elasticsearch/elasticsearch:8.8.1
  • liferay/portal:7.4.3.106-ga106
  • nginx:latest (1.25.3)
  • postgres (psql (PostgreSQL) 16.1 (Debian 16.1-1.pgdg120+1))
  • Docker version 25.0.0, build e758fe5
  • docker-compose version 1.29.2 

And the keycloak: keycloak/keycloak:latest (24.0.1)

This is the error that the liferay provides: 

HTTPResponse httpResponse = httpRequest.send();

TokenResponse tokenResponse = OIDCTokenResponseParser.parse(
httpResponse);

if (tokenResponse instanceof TokenErrorResponse) {
TokenErrorResponse tokenErrorResponse =
(TokenErrorResponse)tokenResponse;

ErrorObject errorObject = tokenErrorResponse.getErrorObject();

JSONObject jsonObject = errorObject.toJSONObject();

throw new OpenIdConnectServiceException.TokenException(
jsonObject.toString());
}

This is the Liferay Log:

2024-03-28 10:52:36.630 ERROR [http-nio-8080-exec-1][StatusDisplayContext:83] Error: {}
2024-03-28 10:52:36.631 DEBUG [http-nio-8080-exec-1][StatusDisplayContext:86] null
com.liferay.portal.security.sso.openid.connect.OpenIdConnectServiceException$TokenException: {}

I set up in Liferay the OpenID setting(System and Instansce settings as well) and I configurated the Keycloak according to this guide: https://techblog.smc.it/en/2021-10-15/how-to-connect-keycloak-liferay-openid-connect