Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error trying to test smtp connection #29062

Closed
1 of 2 tasks
lucaskitinha opened this issue Apr 24, 2024 · 2 comments
Closed
1 of 2 tasks

error trying to test smtp connection #29062

lucaskitinha opened this issue Apr 24, 2024 · 2 comments

Comments

@lucaskitinha
Copy link

Before reporting an issue

  • I have read and understood the above terms for submitting issues, and I understand that my issue may be closed without action if I do not follow them.

Area

authentication/webauthn

Describe the bug

Hi, Im trying to test smtp connection in keycloak using java, im using this method keycloakService.getKeycloakClient().testSMTPConnection(emailConfig);, where emailConfig is a map.

When i try to test the connection in the admin console works perfectly, but when i try with java i only get this error

org.keycloak.services.ErrorResponseException: HTTP 500 Internal Server Error at org.keycloak.services.ErrorResponse.error(ErrorResponse.java:43) at org.keycloak.services.ErrorResponse.error(ErrorResponse.java:36) at org.keycloak.services.resources.admin.RealmAdminResource.testSMTPConnection(RealmAdminResource.java:1003) at org.keycloak.services.resources.admin.RealmAdminResource$quarkusrestinvoker$testSMTPConnection_0bc3cac9c894e7b29eb4c1f2d80a099cba7bdf38.invoke(Unknown Source) at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29) at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141) at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147) at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:582) at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2513) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1538) 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:840) 2024-04-24 18:58:01,052 ERROR [org.keycloak.services.resources.admin.RealmAdminResource] (executor-thread-10) Failed to send email null

I looked it up at the api doc, and for this request i need to send a map in the body

image
I need help to figure out what i need to put in these settings for work

Version

24.0.3

Regression

  • The issue is a regression

Expected behavior

Send the email

Actual behavior

errro
2024-04-24 18:58:01,052 ERROR [org.keycloak.services.resources.admin.RealmAdminResource] (executor-thread-10) Failed to send email

How to Reproduce?

try test smtp connection with java application

Anything else?

No response

@rmartinc
Copy link
Contributor

Hi @lucaskitinha!

If you see in version 24.0.3 line 1003 is this one. So probably your admin user has no email to send the email test message. You have to check the response message to see the error if you are using that endpoint. You can check first using the admin console (to see what teh console is sending in the call) or even curl, and the change to Java. And please don't use github issues for these type of questions. Issues are more for code bugs and enhancements, not for help.

Best regards!

@keycloak-github-bot
Copy link

Thanks for reporting this issue, but this looks like a request for help and not a bug.

For help and questions around Keycloak please see keycloak.org/community.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants