redfroggy / keycloak-verify-email-by-code Goto Github PK
View Code? Open in Web Editor NEWRequired action to verify email by code
License: MIT License
Required action to verify email by code
License: MIT License
After updating Keycloak to v21-0.1 we are getting the following error when entering the provided verification code_
2023-03-24 11:40:38,231 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (executor-thread-1) Uncaught server error: java.lang.NoSuchMethodError: 'org.jboss.resteasy.spi.HttpRequest org.keycloak.authentication.RequiredActionContext.getHttpRequest()'
--
at com.bkool.keycloak.requiredactions.VerifyEmailByCode.processAction(VerifyEmailByCode.java:104)
at org.keycloak.services.resources.LoginActionsService.processRequireAction(LoginActionsService.java:1042)
at org.keycloak.services.resources.LoginActionsService.requiredActionPOST(LoginActionsService.java:977)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:170)
at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:130)
at org.jboss.resteasy.core.ResourceMethodInvoker.internalInvokeOnTarget(ResourceMethodInvoker.java:660)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTargetAfterFilter(ResourceMethodInvoker.java:524)
at org.jboss.resteasy.core.ResourceMethodInvoker.lambda$invokeOnTarget$2(ResourceMethodInvoker.java:474)
at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
at org.jboss.resteasy.core.ResourceMethodInvoker.invokeOnTarget(ResourceMethodInvoker.java:476)
at org.jboss.resteasy.core.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:434)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invokeOnTargetObject(ResourceLocatorInvoker.java:192)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:141)
at org.jboss.resteasy.core.ResourceLocatorInvoker.invoke(ResourceLocatorInvoker.java:32)
at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:492)
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.RoutingContextWrapper.next(RoutingContextWrapper.java:200)
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.RoutingContextWrapper.next(RoutingContextWrapper.java:200)
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.RoutingContextWrapper.next(RoutingContextWrapper.java:200)
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:576)
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:833)
We have this issue since upgrading to keycloak v23.
The required action form is loaded correctly. After entering the code sent to the email an "Internal Server Error" happens.
I am unable to find a lot of logs to this.
The Internal Server Error
happens at POST /realms/nau/login-actions/required-action
[org.keycloak.events] (executor-thread-2) type=REGISTER_ERROR, realmId=8d347b8a-0382-48c8-a443-629f6963bd21, clientId=account-console, userId=null, ipAddress=CENSORED, error=invalid_registration, auth_method=openid-connect, auth_type=code, register_method=form, redirect_uri=CENSORED/realms/nau/account/, code_id=6efe42c9-d168-4642-89df-e6b8f97521d7, [email protected], [email protected]
CUSTOM_REQUIRED_ACTION_ERROR
expired_code
I am honestly not sure how I can debug this further. So looking for help here.
The instruction mentioned seems not applicable for KeyCloak version 18 or 19, could you pl. help here and guide how to enable this feature.
Thanks.
Nous aimerions pour notre projet utiliser un code de vérification d'email sur 6 caractères de type numérique, en remplaçant par exemple String code = RandomString.randomCode(8);
par String code = new RandomString(6, new SecureRandom(), RandomString.digits).nextString();
Est-il possible de rendre configurables la longueur et le type de caractères utilisés ?
Hey, we want to use the plugin for our application. I've already installed and configured it, but when I call 'verify-email' api, I get email without code, only with verification link.
Does it need to add any additional changes in the code? If yes, could you pls help in understanding what needs to be added?
Thank you!
We want to use your plugin for validating an app registration by e-mail code.
Therefore we want to create an in-app screen where we can type in the expected code.
This entered code we want to send to our backend.
The backend should be able to:
Is there a way to ask for the expected code by the Keycloak-API? Or is there a way to send a Code via Rest-API so the plugin checks it by itself?
After upgrading to keycloak 24.0.0 verify-email-by-code screen doesn't work.
<time> ERROR [org.keycloak.services.error.KeycloakErrorHandler] (executor-thread-31) Uncaught server error: java.lang.NoSuchMethodError: 'void org.keycloak.email.freemarker.beans.ProfileBean.<init>(org.keycloak.models.UserModel)'
at fr.redfroggy.keycloak.requiredactions.VerifyEmailByCode.createFormChallenge(VerifyEmailByCode.java:74)
at fr.redfroggy.keycloak.requiredactions.VerifyEmailByCode.sendVerifyEmailAndCreateForm(VerifyEmailByCode.java:180)
according to docs constructor definition has changed
23.*
https://www.keycloak.org/docs-api/23.0.5/javadocs/org/keycloak/email/freemarker/beans/ProfileBean.html
Email sending works fine, but createFormChallenge fails to display form for email verification
Hi
Please suggest on how can we set the expiry time of the code thats generated for email verification.
Regards,
Shaheer
After filling the registration form the email code is send but the form to enter it is not presented, instead we get an error 500
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.