Two level authentication in Keycloak.
by Bhanu Kiran
Hi Team,
Please let me know how we can implement below requirement.
1. Two level authentication in Keycloak.
-
In first level authenticate user with Ldap and if validation fails
authenticate same user with configured DB. Does Keycloak support this
feature or how we have to implement this multi-level authentication.
I was able to configure ldap with my keycloak server and validate users.
But I was not able to find any example how to configure external DB to
authenticate users.
Please let me hot to configure external DB.
Thanks,
Bhanu
9 years, 4 months
Application roles (1.1.0 to 1.4.0)
by Emil Posmyk
Hi all
I'm trying to get a list of application roles like it was before migration
from 1.1.0.Final but I'm reciving status 404.
Was in 1.1.0: /auth/admin/realms/{realm}/applications/{app-name}/roles
Is now in 1.4.0: /auth/admin/realms/{realm}/clients/{id}/roles
in second path "{id}" is the same like it was earlier {app-name}
*Do you have any idea what can be wrong ?*
*thanks*
*--*
*Emil Posmyk*
9 years, 4 months
User attributes as custom claims?
by Scott Rossillo
Hi,
Is there a way to get user attributes returned from Keycloak by requesting it as a claim or some other method? The only way I can get user attributes right now is via an admin api call for a user resource. Am I missing something?
Thanks,
Scott
9 years, 4 months
Keycloak working with Spring Boot / Spring Security OAuth?
by Ed Hillmann
Hi. I am trying to get this sample application working against a local
keycloak instance
https://github.com/spring-cloud-samples/sso
As I understand it, it's a Spring Boot application using Spring Security to
support SSO. And I can't get it (as the client) to interact with the
KeyCloak authentication server.
If I just add the configuration for the Spring Boot adapter alone, it
attempts to call out to KeyCloak but the url always includes a redirect_uri
parameter, which Keycloak doesn't like and displays an error instead of a
login screen.
I've then tried to add, in addition to the Spring Boot configuration, the
integration with Spring Security (the next section in the KeyCloak
documentation). When I that, however, the server complains because it
cannot find the keycloak.json file. Which isn't there because I've added
the details to the application.yml file (as directed by the Spring Boot
config)
Is there some last step that I need to do to get these working? I'm new to
Spring Boot. so I'm not sure I know how to step through it's configuration
to see why it insists on sending the redirect_uri, and including Spring
Security seems like a miss.
Thanks for any help,
Ed
9 years, 4 months
User Federation Entity Manager Access
by Tristan Paddock
Hi All,
I am trying to write a custom User Federation to a RDBMS and would like to
use an entity manager over straight JDBC. My code for creating a
EntityManagerFactory takes a lot from
DefaultJpaConnectionProviderFactory.java. The issue I am running into is
that my persistance.xml (under META-INF of my jar) does not seem to be
getting picked up. It appears to be picking up the persistence-unit from
JpaConnection, but not mine.
Does any one have thoughts on this or a sold strategy for creating an
EntityManagerFactory in a custom User Federation?
Thanks,
Tristan
9 years, 4 months
Direct Access to KeyCloak
by Christopher Davies
I am trying to write a test harness for out application which uses
KeyCloak.
In order to run my tests I need to manipulate KeyCloak.
I am able to get data out of KeyCloak using the REST API. However I am
unclear what I should send to KeyCloak to change a setting.
I was trying to set the role for a user and wrote the script at the bottom
of the email.
I get back an error of org.codehaus.jackson.map.JsonMappingException: Can
not deserialize instance of java.util.ArrayList out of START_OBJECT token
at [Source: io.undertow.servlet.spec.ServletInputStreamImpl@73cda37e;
line: 1, column: 1]
I have obviously missed a key point in the format of my data, but cannot
see what it is.
Chris
---------------------------------------
#!/bin/bash
host=192.168.10.221:8088
realm=ATS-ci
t=$(curl -X POST
http://${host}/auth/realms/${realm}/protocol/openid-connect/token
--data "username=${1}" --data "password=${2}" --data "grant_type=password"
--data "client_id=client" 2>/dev/null | jq -r ".id_token")
client=$(curl http://${host}/auth/admin/realms/${realm}/clients -H "Accept:
application/json" -H "Authorization: Bearer ${t}" 2>/dev/null | jq -r ".[]
| select(.name == \"client\").id")
user=$(curl http://${host}/auth/admin/realms/${realm}/users -H "Accept:
application/json" -H "Authorization: Bearer ${t}" 2>/dev/null | jq -r ".[]
| select(.username == \"${3}\").id")
echo ${client}
echo ${user}
echo "Roles"
curl http://${host}/auth/admin/realms/${realm}/clients/${client}/roles \
-H "Accept: application/json" \
-H "Authorization: Bearer ${t}" 2>/dev/null | jq -r ".[] | {id, name }"
echo ""
echo "Roles:${3}"
curl http://${host}/auth/admin/realms/${realm}/users/${user}/role-mappings/clients/${client}
\
-H "Accept: application/json" \
-H "Authorization: Bearer ${t}" 2>/dev/null | jq -r ".[] | {id, name }"
curl http://${host}/auth/admin/realms/${realm}/users/${user}/role-mappings/clients/${client}
\
-X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${t}" \
--data "{'realm': 'ATS-${realm}', 'id': '${user}', 'client': '${client}',
'\$entity': [ 'operator' ] }"
9 years, 4 months
JGRP000010 Version Mismatch errors from running in HA mode
by Eugene Chow
Hi guys,
I’m running a Keycloak cluster testbed and I keep getting this message even though only 1 instance of Keycloak is running in HA mode. The Keycloak instances are running in KVM containers on a single host machine.
> 04:08:36,494 WARNING [org.jgroups.protocols.UDP] (Incoming-4,ee,keycloak1) JGRP000010: packet from 192.168.122.1:1029 has different version (3.4.5) than ours (3.6.4); packet is discarded
> 07:16:46,508 WARNING [org.jgroups.protocols.UDP] (Incoming-2,ee,keycloak1) JGRP000010: packet from 192.168.122.1:45688 has different version (3.4.5) than ours (3.6.4); packet is discarded
It seems like Keycloak/Infinispan is sending malformed (ie. version mismatch) multicast packets that it would reject. Is there a way to fix this?
Thanks in advance!
9 years, 4 months
Desktop Apps
by Christopher Davies
I am looking to use KeyCloak to authenticate our software.
Some of our the components of our software are java desktop applications.
I know that I can send an openid connection from my application to KeyCloak
to get a JWT. Looking at this protocol, it seems only to support
username/password. Is there a recommended way to use Kerberose, to
authenticate so that my windows users do not need to type username/password
if they are logged in correctly to their desktops ?
Chris
9 years, 4 months
WebSockets
by Juraci Paixão Kröhling
I'm currently looking into the best way to perform authentication for
WebSockets, and it seems that the best (only?) option so far is to
handle this on the socket's endpoint itself.
But before I start with some library for the other Hawkular components
to consume, I'd like to ask if there's a best practices/recommendations
for doing WebSocket authentication with Keycloak.
My plan right now is to require the endpoints to inject a service that
would accept a message and session, closing the session on this service
if the login data is not provided (login data == token, send on the
first message, at least at first).
Ideas/thoughts?
- Juca.
9 years, 4 months
Updating Oracle database schema to 1.3.1 fails
by Hipfinger Martin (BCC.ÖBB.TicketShop.MA)
i have a working setup with keycloak 1.1.0 using Oracle.
When I try to upgrade schema using Keycloak 1.3.1.Final it fails.
Setting in keycloak-server.json
"connectionsJpa": {
"default":
{ "dataSource": "java:jboss/datasources/myDS", "databaseSchema": "update" }
}
upgrade to 1.2.0:
15:35:35,309 ERROR [org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider] (MSC service thread 1-2) Change Set META-INF/jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::psilva@redhat.com failed. Error: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
at liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:185)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1208)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:550)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
at liquibase.Liquibase.update(Liquibase.java:200)
at liquibase.Liquibase.update(Liquibase.java:181)
at org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider.update(LiquibaseJpaUpdaterProvider.java:84) [keycloak-connections-jpa-liquibase-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.lazyInit(DefaultJpaConnectionProviderFactory.java:143) [keycloak-connections-jpa-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:35) [keycloak-connections-jpa-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:25) [keycloak-connections-jpa-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:99) [keycloak-services-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.java:34) [keycloak-model-jpa-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.java:16) [keycloak-model-jpa-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:99) [keycloak-services-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.models.cache.DefaultCacheRealmProvider.getDelegate(DefaultCacheRealmProvider.java:70) [keycloak-invalidation-cache-model-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.models.cache.DefaultCacheRealmProvider.getRealm(DefaultCacheRealmProvider.java:163) [keycloak-invalidation-cache-model-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.services.managers.ApplianceBootstrap.bootstrap(ApplianceBootstrap.java:40) [keycloak-services-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.services.managers.ApplianceBootstrap.bootstrap(ApplianceBootstrap.java:31) [keycloak-services-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.services.resources.KeycloakApplication.setupDefaultRealm(KeycloakApplication.java:155) [keycloak-services-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:86) [keycloak-services-1.2.0.Final.jar:1.2.0.Final]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_40]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_40]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_40]
at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [rt.jar:1.8.0_40]
at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:148) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2211) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:295) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:236) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:112) [resteasy-jaxrs-3.0.10.Final.jar:]
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36) [resteasy-jaxrs-3.0.10.Final.jar:]
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:79)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:220) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:125) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:508) [undertow-servlet-1.1.0.Final.jar:1.1.0.Final]
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:88)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_40]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]
Caused by: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
at org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.generateStatementsImpl(JpaUpdate1_2_0_Beta1.java:43) [keycloak-connections-jpa-liquibase-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.connections.jpa.updater.liquibase.custom.CustomKeycloakTask.generateStatements(CustomKeycloakTask.java:79) [keycloak-connections-jpa-liquibase-1.2.0.Final.jar:1.2.0.Final]
at liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:178)
... 43 more
Caused by: java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Long
at org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.addDefaultProtocolMappers(JpaUpdate1_2_0_Beta1.java:296) [keycloak-connections-jpa-liquibase-1.2.0.Final.jar:1.2.0.Final]
at org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.generateStatementsImpl(JpaUpdate1_2_0_Beta1.java:41) [keycloak-connections-jpa-liquibase-1.2.0.Final.jar:1.2.0.Final]
... 45 more
15:35:35,344 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./auth: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./auth: Failed to start service
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1904) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_40]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_40]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_40]
Caused by: java.lang.RuntimeException: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:160)
at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2211)
at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:295)
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:236)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:112)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:79)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:220)
at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:125)
at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:508)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:88)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.start(UndertowDeploymentService.java:72)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.2.Final.jar:1.2.2.Final]
... 3 more
Caused by: java.lang.RuntimeException: Failed to update database
at org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider.update(LiquibaseJpaUpdaterProvider.java:87)
at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.lazyInit(DefaultJpaConnectionProviderFactory.java:143)
at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:35)
at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:25)
at org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:99)
at org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.java:34)
at org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.java:16)
at org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:99)
at org.keycloak.models.cache.DefaultCacheRealmProvider.getDelegate(DefaultCacheRealmProvider.java:70)
at org.keycloak.models.cache.DefaultCacheRealmProvider.getRealm(DefaultCacheRealmProvider.java:163)
at org.keycloak.services.managers.ApplianceBootstrap.bootstrap(ApplianceBootstrap.java:40)
at org.keycloak.services.managers.ApplianceBootstrap.bootstrap(ApplianceBootstrap.java:31)
at org.keycloak.services.resources.KeycloakApplication.setupDefaultRealm(KeycloakApplication.java:155)
at org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:86)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.8.0_40]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) [rt.jar:1.8.0_40]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.8.0_40]
at java.lang.reflect.Constructor.newInstance(Constructor.java:422) [rt.jar:1.8.0_40]
at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:148)
... 18 more
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set META-INF/jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::psilva@redhat.com:
Reason: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:586)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
at liquibase.Liquibase.update(Liquibase.java:200)
at liquibase.Liquibase.update(Liquibase.java:181)
at org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider.update(LiquibaseJpaUpdaterProvider.java:84)
... 36 more
Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
at liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:185)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1208)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:550)
... 41 more
Caused by: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
at org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.generateStatementsImpl(JpaUpdate1_2_0_Beta1.java:43)
at org.keycloak.connections.jpa.updater.liquibase.custom.CustomKeycloakTask.generateStatements(CustomKeycloakTask.java:79)
at liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:178)
... 43 more
Caused by: java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Long
at org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.addDefaultProtocolMappers(JpaUpdate1_2_0_Beta1.java:296)
at org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.generateStatementsImpl(JpaUpdate1_2_0_Beta1.java:41)
... 45 more
15:35:35,366 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("add") failed - address: ([("deployment" => "main-auth-server.war")]) - failure description: {"JBAS014671: Failed services" => {"jboss.undertow.deployment.default-server.default-host./auth" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./auth: Failed to start service
Caused by: java.lang.RuntimeException: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
Caused by: java.lang.RuntimeException: Failed to update database
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set META-INF/jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::psilva@redhat.com:
Reason: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
Caused by: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
Caused by: java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Long"}}
upgrade to 1.3.1:
14:40:00,682 INFO [org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider] (ServerService Thread Pool - 61) Updating database
14:40:01,905 ERROR [org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider] (ServerService Thread Pool - 61) Change Set META-INF/jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::psilva@redhat.com failed. Error: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
at liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:185)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1208)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:550)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
at liquibase.Liquibase.update(Liquibase.java:200)
at liquibase.Liquibase.update(Liquibase.java:181)
at org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider.update(LiquibaseJpaUpdaterProvider.java:84)
at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.lazyInit(DefaultJpaConnectionProviderFactory.java:143)
at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:35)
at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:25)
at org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:99)
at org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.java:34)
at org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.java:16)
at org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:99)
at org.keycloak.models.cache.DefaultCacheRealmProvider.getDelegate(DefaultCacheRealmProvider.java:70)
at org.keycloak.models.cache.DefaultCacheRealmProvider.getRealm(DefaultCacheRealmProvider.java:163)
at org.keycloak.services.managers.ApplianceBootstrap.bootstrap(ApplianceBootstrap.java:40)
at org.keycloak.services.managers.ApplianceBootstrap.bootstrap(ApplianceBootstrap.java:31)
at org.keycloak.services.resources.KeycloakApplication.setupDefaultRealm(KeycloakApplication.java:157)
at org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:87)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:148)
at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2211)
at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:295)
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:236)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:112)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:230)
at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:131)
at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:511)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
at org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.generateStatementsImpl(JpaUpdate1_2_0_Beta1.java:43)
at org.keycloak.connections.jpa.updater.liquibase.custom.CustomKeycloakTask.generateStatements(CustomKeycloakTask.java:79)
at liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:178)
... 44 more
Caused by: java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Long
at org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.addDefaultProtocolMappers(JpaUpdate1_2_0_Beta1.java:296)
at org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.generateStatementsImpl(JpaUpdate1_2_0_Beta1.java:41)
... 46 more
14:40:01,930 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool - 61) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./auth: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./auth: java.lang.RuntimeException: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)
Caused by: java.lang.RuntimeException: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:160)
at org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2211)
at org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:295)
at org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:236)
at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:112)
at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.init(HttpServletDispatcher.java:36)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:230)
at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:131)
at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:511)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:101)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)
... 6 more
Caused by: java.lang.RuntimeException: Failed to update database
at org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider.update(LiquibaseJpaUpdaterProvider.java:87)
at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.lazyInit(DefaultJpaConnectionProviderFactory.java:143)
at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:35)
at org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:25)
at org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:99)
at org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.java:34)
at org.keycloak.models.jpa.JpaRealmProviderFactory.create(JpaRealmProviderFactory.java:16)
at org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:99)
at org.keycloak.models.cache.DefaultCacheRealmProvider.getDelegate(DefaultCacheRealmProvider.java:70)
at org.keycloak.models.cache.DefaultCacheRealmProvider.getRealm(DefaultCacheRealmProvider.java:163)
at org.keycloak.services.managers.ApplianceBootstrap.bootstrap(ApplianceBootstrap.java:40)
at org.keycloak.services.managers.ApplianceBootstrap.bootstrap(ApplianceBootstrap.java:31)
at org.keycloak.services.resources.KeycloakApplication.setupDefaultRealm(KeycloakApplication.java:157)
at org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:87)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:148)
... 19 more
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set META-INF/jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::psilva@redhat.com:
Reason: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:586)
at liquibase.changelog.visitor.UpdateVisitor.visit(UpdateVisitor.java:43)
at liquibase.changelog.ChangeLogIterator.run(ChangeLogIterator.java:73)
at liquibase.Liquibase.update(Liquibase.java:200)
at liquibase.Liquibase.update(Liquibase.java:181)
at org.keycloak.connections.jpa.updater.liquibase.LiquibaseJpaUpdaterProvider.update(LiquibaseJpaUpdaterProvider.java:84)
... 37 more
Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
at liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:185)
at liquibase.database.AbstractJdbcDatabase.executeStatements(AbstractJdbcDatabase.java:1208)
at liquibase.changelog.ChangeSet.execute(ChangeSet.java:550)
... 42 more
Caused by: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
at org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.generateStatementsImpl(JpaUpdate1_2_0_Beta1.java:43)
at org.keycloak.connections.jpa.updater.liquibase.custom.CustomKeycloakTask.generateStatements(CustomKeycloakTask.java:79)
at liquibase.change.custom.CustomChangeWrapper.generateStatements(CustomChangeWrapper.java:178)
... 44 more
Caused by: java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Long
at org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.addDefaultProtocolMappers(JpaUpdate1_2_0_Beta1.java:296)
at org.keycloak.connections.jpa.updater.liquibase.custom.JpaUpdate1_2_0_Beta1.generateStatementsImpl(JpaUpdate1_2_0_Beta1.java:41)
... 46 more
14:40:01,945 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("add") failed - address: ([("deployment" => "keycloak-server.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.undertow.deployment.default-server.default-host./auth" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./auth: java.lang.RuntimeException: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
Caused by: java.lang.RuntimeException: Failed to construct public org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
Caused by: java.lang.RuntimeException: Failed to update database
Caused by: liquibase.exception.MigrationFailedException: Migration failed for change set META-INF/jpa-changelog-1.2.0.Beta1.xml::1.2.0.Beta1::psilva@redhat.com:
Reason: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
Caused by: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
Caused by: liquibase.exception.CustomChangeException: Update 1.2.0.Beta1: Exception when updating data from previous version
Caused by: java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.Long"}}
Thx for your help!
9 years, 4 months