Mongo and 2.0.0.Final
by John Bartko
Hello all,
I get the following stack trace attempting to use 2.0.0.Final against a
MongoDB backend. Following the keycloak-mongo
<https://github.com/jboss-dockerfiles/keycloak/tree/master/server-mongo>
readme should reproduce the behavior.
21:58:31,802 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool
-- 47) 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: RESTEASY003325: 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: RESTEASY003325: 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:162)
at
org.jboss.resteasy.spi.ResteasyProviderFactory.createProviderInstance(ResteasyProviderFactory.java:2209)
at
org.jboss.resteasy.spi.ResteasyDeployment.createApplication(ResteasyDeployment.java:299)
at
org.jboss.resteasy.spi.ResteasyDeployment.start(ResteasyDeployment.java:240)
at
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.init(ServletContainerDispatcher.java:113)
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:231)
at
io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:132)
at
io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:526)
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: Property 'databaseSchema' needs to
be specified in the configuration
at
org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.lazyInit(DefaultJpaConnectionProviderFactory.java:131)
at
org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:60)
at
org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory.create(DefaultJpaConnectionProviderFactory.java:48)
at
org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:103)
at
org.keycloak.authorization.jpa.store.JPAAuthorizationStoreFactory.getEntityManager(JPAAuthorizationStoreFactory.java:54)
at
org.keycloak.authorization.jpa.store.JPAAuthorizationStoreFactory.create(JPAAuthorizationStoreFactory.java:35)
at
org.keycloak.authorization.jpa.store.JPAAuthorizationStoreFactory.create(JPAAuthorizationStoreFactory.java:32)
at
org.keycloak.services.DefaultKeycloakSession.getProvider(DefaultKeycloakSession.java:103)
at
org.keycloak.models.authorization.infinispan.CachedPolicyStore.getStoreFactory(CachedPolicyStore.java:193)
at
org.keycloak.models.authorization.infinispan.CachedPolicyStore.getDelegate(CachedPolicyStore.java:201)
at
org.keycloak.models.authorization.infinispan.CachedPolicyStore.findByType(CachedPolicyStore.java:179)
at
org.keycloak.authorization.policy.provider.drools.DroolsPolicyProviderFactory$1.onEvent(DroolsPolicyProviderFactory.java:75)
at
org.keycloak.services.DefaultKeycloakSessionFactory.publish(DefaultKeycloakSessionFactory.java:64)
at
org.keycloak.services.resources.KeycloakApplication.<init>(KeycloakApplication.java:130)
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:423)
at
org.jboss.resteasy.core.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:150)
... 19 more
21:58:31,809 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: RESTEASY003325: Failed to construct public
org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
Caused by: java.lang.RuntimeException: RESTEASY003325: Failed to
construct public
org.keycloak.services.resources.KeycloakApplication(javax.servlet.ServletContext,org.jboss.resteasy.core.Dispatcher)
Caused by: java.lang.RuntimeException: Property 'databaseSchema' needs
to be specified in the configuration"}}
Any thoughts?
Thanks,
-John Bartko
8 years, 5 months
how get info from adapterConfig
by LIEVRE Olivier
Hello,
I've secured a REST server with keycloak 1.9.7, and I would like to implement a public REST GET method for an non-authenticated user to get the adapderConfig info linked to my war.
My war adapter is configured in my standalone.xml.
Is there an easy way to read the adapterConfig info from standalone in that case?
When a user makes an authenticated request, I can get that info with getting RefreshableKeycloakSecurityContext from httprequest.
KR,
Olivier
8 years, 5 months
Hardcoded Role Mapper Problem
by Jérôme Blanchard
Hi,
I use a Role Mapper on an Identity Provider but it's not working as
expected :
- If the account does not exists and Identity Provider Auth is used to
create a new account, Role is applied to the newly created keycloak account.
- But if an account already exists and that I use the Identity Provider
Association, the Role is not applied to the already existing keycloak
account and the mapper has no effect, leaving the account in a unconsistent
state for me...
Is it a normal behaviour, is it fixed in latest releases (I use 1.7.0) ??
Thanks, Jérôme.
8 years, 5 months
Stian: Continuation of Memory Leak Investigation
by Chris Hairfield
*My replies started bouncing; guess I sent too many pictures ;)*
I'd be perfectly happy with that throughput. What other parameters did you
run it under?
JAVA_OPTS: "-server -Xms1g -Xmx4g -XX:MetaspaceSize=96M
-XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true
-Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
-XX:+UseParallelGC -XX:ParallelGCThreads=4"
Run command: bin/standalone.sh -c standalone.xml
My standalone.xml:
<cache-container name="keycloak"
jndi-name="infinispan/Keycloak">
<local-cache name="realms"/>
<local-cache name="users">
<eviction max-entries="10000" strategy="LRU"/>
</local-cache>
<local-cache name="sessions"/>
<local-cache name="offlineSessions"/>
<local-cache name="loginFailures"/>
<local-cache name="work"/>
<local-cache name="realmVersions">
<transaction mode="BATCH" locking="PESSIMISTIC"/>
<eviction max-entries="10000" strategy="LRU"/>
</local-cache>
</cache-container>
You can see memory starting to thrash at a higher rate (up to 1.4 GB). I
only created 22k users in this test.
8 years, 5 months
Karaf Features problem
by Ygor Castor
I'm trying to install the keycloak adapter at Karaf 4.0.5, but i'm running
in some problems, this one i'm not being able to solve:
karaf@root()> feature:install keycloak-adapter-core
Error executing command: Unable to resolve root: missing requirement [root]
osgi.identity; osgi.identity=keycloak-adapter-core; type=karaf.feature;
version="[2.0.0.CR1,2.0.0.CR1]";
filter:="(&(osgi.identity=keycloak-adapter-core)(type=karaf.feature)(version>=2.0.0.CR1)(version<=2.0.0.CR1))"
[caused by: Unable to resolve keycloak-adapter-core/2.0.0.CR1: missing
requirement [keycloak-adapter-core/2.0.0.CR1] osgi.identity;
osgi.identity=org.keycloak.keycloak-adapter-core; type=osgi.bundle;
version="[2.0.0.CR1,2.0.0.CR1]"; resolution:=mandatory [caused by: Unable
to resolve org.keycloak.keycloak-adapter-core/2.0.0.CR1: missing
requirement [org.keycloak.keycloak-adapter-core/2.0.0.CR1]
osgi.wiring.package;
filter:="(&(osgi.wiring.package=org.keycloak.authorization.client)(version>=2.0.0.CR1))"]]
It seems that the feature can't find the "org.keycloak.authorization"
bundle, how can i fix this?
8 years, 5 months
Disallow Join via OAuth?
by Chris Hairfield
I don't expect this is possible, but does anyone know whether one can
prevent new account creation when Identity Brokering with Facebook and
Google while still allowing sign-in?
We are attempting to migrate our legacy IDM solution to Keycloak slowly and
wish, for the time being, for all new account creation to still go through
the legacy app. We have HAProxy in front of Keycloak. Is there a way to
redirect users attempting to join via Facebook or Google to our legacy join
page?
8 years, 5 months
keycloak-nodejs-connect with Express routes
by Scott Rossillo
Hey,
I’m trying to register the NodeJS Keycloak Connect (0.22) with Express routes, such as:
var foo = require('./routes/foo’);
app.use(‘/foo’, foo);
The problems are:
1. Adding the Keycloak protect middleware with "app.use(‘foo’, keycloak.protect(), foo)” causes infinite redirects
2. It can’t be registered in the route javascript file because keycloak.protect() expects the already initialized keycloak function.
When dealing with large applications, it’s not feasible to register all routes in the main Express file.
Any pointers or am I missing something?
Thanks in advance,
Scott
Scott Rossillo
Smartling | Senior Software Engineer
srossillo(a)smartling.com
8 years, 5 months