Mobile authenticator setup page throws errors
fbrettnich opened this issue · comments
Steps to reproduce:
- Go to
Manage account
- Go to
Signing in
(Account security) - Click
Set up authenticator application
- If required enter your password again
- Get the error "We are sorry... An internal server error has occurred"
Environment:
- Keyclock version 20.0.0 (Docker)
- Keywind latest version, without modifications
Expected behavior:
Mobile Authenticator Setup page
Error log:
==> totp.policy.supportedApplications [in template "login-config-totp.ftl" at line 22, column 18]
----
Tip: It's the step after the last dot that caused this error, not those before it.
----
Tip: If the failing expression is known to legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing</#if>. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)??
----
----
FTL stack trace ("~" means nesting-related):
- Failed at: #list totp.policy.supportedApplicatio... [in template "login-config-totp.ftl" at line 22, column 11]
~ Reached through: #nested "form" [in template "template.ftl" in macro "registrationLayout" at line 44, column 13]
~ Reached through: #nested [in template "components/layout/card-main.ftl" in macro "kw" at line 3, column 5]
~ Reached through: @cardMain.kw [in template "template.ftl" in macro "registrationLayout" at line 40, column 11]
~ Reached through: #nested [in template "components/layout/card.ftl" in macro "kw" at line 3, column 5]
~ Reached through: @card.kw [in template "template.ftl" in macro "registrationLayout" at line 29, column 9]
~ Reached through: #nested [in template "components/layout/container.ftl" in macro "kw" at line 4, column 7]
~ Reached through: @container.kw [in template "template.ftl" in macro "registrationLayout" at line 28, column 7]
- Reached through: @layout.registrationLayout displayMes... [in template "login-config-totp.ftl" at line 9, column 1]
----
at freemarker.core.InvalidReferenceException.getInstance(InvalidReferenceException.java:134)
at freemarker.core.Expression.assertNonNull(Expression.java:249)
at freemarker.core.IteratorBlock.acceptWithResult(IteratorBlock.java:104)
at freemarker.core.IteratorBlock.accept(IteratorBlock.java:94)
at freemarker.core.Environment.visit(Environment.java:347)
at freemarker.core.Environment.visit(Environment.java:389)
at freemarker.core.Environment.invokeNestedContent(Environment.java:633)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:60)
at freemarker.core.Environment.visit(Environment.java:383)
at freemarker.core.Environment.invokeNestedContent(Environment.java:633)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:60)
at freemarker.core.Environment.visit(Environment.java:383)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:889)
at freemarker.core.Environment.invokeMacro(Environment.java:825)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
at freemarker.core.Environment.visit(Environment.java:383)
at freemarker.core.Environment.invokeNestedContent(Environment.java:633)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:60)
at freemarker.core.Environment.visit(Environment.java:383)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:889)
at freemarker.core.Environment.invokeMacro(Environment.java:825)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
at freemarker.core.Environment.visit(Environment.java:383)
at freemarker.core.Environment.invokeNestedContent(Environment.java:633)
at freemarker.core.BodyInstruction.accept(BodyInstruction.java:60)
at freemarker.core.Environment.visit(Environment.java:383)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:889)
at freemarker.core.Environment.invokeMacro(Environment.java:825)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
at freemarker.core.Environment.visit(Environment.java:383)
at freemarker.core.Environment.invokeMacroOrFunctionCommonPart(Environment.java:889)
at freemarker.core.Environment.invokeMacro(Environment.java:825)
at freemarker.core.UnifiedCall.accept(UnifiedCall.java:84)
at freemarker.core.Environment.visit(Environment.java:347)
at freemarker.core.Environment.visit(Environment.java:353)
at freemarker.core.Environment.process(Environment.java:326)
at freemarker.template.Template.process(Template.java:383)
at org.keycloak.theme.freemarker.DefaultFreeMarkerProvider.processTemplate(DefaultFreeMarkerProvider.java:49)
... 56 more
2022-11-02 19:55:11,830 ERROR [org.keycloak.headers.DefaultSecurityHeadersProvider] (executor-thread-38) MediaType not set on path /realms/master/login-actions/required-action, with response status 500
2022-11-02 19:55:11,831 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (executor-thread-38) Uncaught server error: javax.ws.rs.InternalServerErrorException: HTTP 500 Internal Server Error
at org.keycloak.headers.DefaultSecurityHeadersProvider.addHeaders(DefaultSecurityHeadersProvider.java:75)
at org.keycloak.services.filters.KeycloakSecurityHeadersFilter.filter(KeycloakSecurityHeadersFilter.java:42)
at org.jboss.resteasy.core.interception.jaxrs.ContainerResponseContextImpl.filter(ContainerResponseContextImpl.java:367)
at org.jboss.resteasy.core.ServerResponseWriter.executeFilters(ServerResponseWriter.java:252)
at org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:101)
at org.jboss.resteasy.core.ServerResponseWriter.writeNomapResponse(ServerResponseWriter.java:74)
at org.jboss.resteasy.core.SynchronousDispatcher.writeResponse(SynchronousDispatcher.java:594)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:524)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)
at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)
at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247)
at io.quarkus.resteasy.runtime.standalone.RequestDispatcher.service(RequestDispatcher.java:73)
at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.dispatch(VertxRequestHandler.java:151)
at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.handle(VertxRequestHandler.java:82)
at io.quarkus.resteasy.runtime.standalone.VertxRequestHandler.handle(VertxRequestHandler.java:42)
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1284)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:173)
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:140)
at io.quarkus.vertx.http.runtime.StaticResourcesRecorder$2.handle(StaticResourcesRecorder.java:84)
at io.quarkus.vertx.http.runtime.StaticResourcesRecorder$2.handle(StaticResourcesRecorder.java:71)
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1284)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:173)
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:140)
at io.quarkus.vertx.http.runtime.VertxHttpRecorder$6.handle(VertxHttpRecorder.java:430)
at io.quarkus.vertx.http.runtime.VertxHttpRecorder$6.handle(VertxHttpRecorder.java:408)
at io.vertx.ext.web.impl.RouteState.handleContext(RouteState.java:1284)
at io.vertx.ext.web.impl.RoutingContextImplBase.iterateNext(RoutingContextImplBase.java:173)
at io.vertx.ext.web.impl.RoutingContextImpl.next(RoutingContextImpl.java:140)
at org.keycloak.quarkus.runtime.integration.web.QuarkusRequestFilter.lambda$createBlockingHandler$0(QuarkusRequestFilter.java:82)
at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:564)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:829)```
Strange, works for me, just tested. What OTP Type
have you configured under Authentication > OTP Policy
and whats listed under Supported Applications
? Should be FreeOTP, Google Authenticator
, something hardcoded i guess.
Edit: Sorry, im running 19 legacy, maybe thats why
Edit2: Just tried it under version 20 after a painful migration, basically every docker env var had changed, but the theme is still working.
Strange, works for me, just tested. What
OTP Type
have you configured underAuthentication > OTP Policy
and whats listed underSupported Applications
? Should beFreeOTP, Google Authenticator
, something hardcoded i guess.Edit: Sorry, im running 19 legacy, maybe thats why
Edit2: Just tried it under version 20 after a painful migration, basically every docker env var had changed, but the theme is still working.
The default values are configured there...
By the way, the same occurs during login (also for WebAuthn), without the theme everything works
Very strange, i have the exact same settings. WebAuthn will throw errors if you haven't merged my PR #23 locally yet.
edit: sorry, wrong info, SETUP doesn't work, i already now why ( keycloak/keycloak#14800 ) will create a PR now.
edit2: @fbrettnich only a small change, you may try it locally until it gets merged: #24