<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p id="yui_3_16_0_1_1447861079041_124735" style="margin: 0px;
padding: 0px; display: block; color: rgb(0, 0, 0); font-family:
HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida
Grande', sans-serif; font-size: 13px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span>Hi
Ataraxus,</span></p>
<p id="yui_3_16_0_1_1447861079041_124740" style="margin: 0px;
padding: 0px; display: block; color: rgb(0, 0, 0); font-family:
HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida
Grande', sans-serif; font-size: 13px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span><br>
</span></p>
<p id="yui_3_16_0_1_1447861079041_124741" dir="ltr" data-setdir="false" style="margin: 0px; padding: 0px; text-align:
start; display: block; color: rgb(0, 0, 0); font-family:
HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida
Grande', sans-serif; font-size: 13px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span id="yui_3_16_0_1_1447861079041_124783">I think the way to solve
this is 'tapping in' to the Wildfly module system. You need to
add a module.xml to your provider jar under
src/main/resources/modules/some/module/name/module.xml and
include a reference to the java mail api there. That way you can
tell Wildfly to include that on the classpath when it's loading
your provider classes.<br>
</span></p>
<p dir="ltr" data-setdir="false" style="margin: 0px; padding: 0px;
text-align: start; display: block; color: rgb(0, 0, 0);
font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial,
'Lucida Grande', sans-serif; font-size: 13px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: auto; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span id="yui_3_16_0_1_1447861079041_124783"><br>
I'm sorry, but I'm not sure how exactly this works in detail
with path names and module.xml contents. You can look at the
keycloak sources for module.xml examples, read the Wildfly
module system documentation or maybe someone else on the mailing
list can answer you in more detail. Good luck!<br>
<br>
</span></p>
<br style="color: rgb(0, 0, 0); font-family: HelveticaNeue,
'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;
font-size: 13px; font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height: normal;
orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: 1;
word-spacing: 0px; -webkit-text-stroke-width: 0px;">
<blockquote id="yui_3_16_0_1_1447861079041_124682" style="margin:
5px 1em 1em 5px; display: block; color: rgb(0, 0, 0); font-family:
HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida
Grande', sans-serif; font-size: 13px; font-style: normal;
font-variant: normal; font-weight: normal; letter-spacing: normal;
line-height: normal; orphans: auto; text-align: start;
text-indent: 0px; text-transform: none; white-space: normal;
widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;
border-left-width: 2px; border-left-style: solid;
border-left-color: rgb(16, 16, 255); padding-left: 5px;">
<div id="yui_3_16_0_1_1447861079041_124681" style="font-family:
HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida
Grande', sans-serif; font-size: 13px;">
<div id="yui_3_16_0_1_1447861079041_124680" style="font-family:
HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida
Grande', sans-serif; font-size: 16px;">
<div dir="ltr" id="yui_3_16_0_1_1447861079041_124679" style="text-align: start;">
<hr id="yui_3_16_0_1_1447861079041_124808" size="1"><font id="yui_3_16_0_1_1447861079041_124683" face="Arial" size="2"><b><span style="font-weight: bold;">From:</span></b><span class="Apple-converted-space"> </span>Ataraxus
<a class="moz-txt-link-rfc2396E" href="mailto:atx@binaryninja.de"><atx@binaryninja.de></a><br>
<b><span style="font-weight: bold;">To:</span></b><span class="Apple-converted-space"> </span><a class="moz-txt-link-rfc2396E" href="mailto:ewjmulder@yahoo.com">"ewjmulder@yahoo.com"</a>
<a class="moz-txt-link-rfc2396E" href="mailto:ewjmulder@yahoo.com"><ewjmulder@yahoo.com></a><span class="Apple-converted-space"> </span><br>
<b><span style="font-weight: bold;">Sent:</span></b><span class="Apple-converted-space"> </span>Monday, November
23, 2015 1:57 PM<br>
<b><span style="font-weight: bold;">Subject:</span></b><span class="Apple-converted-space"> </span>Re:
[keycloak-user] Provider Dependencies<br>
</font></div>
<div class="y_msg_container" id="yui_3_16_0_1_1447861079041_124684"><br>
<div id="yiv9319221611">
<div id="yui_3_16_0_1_1447861079041_124685">Here is the
code and the stacktrace just in case, maybe there is a
better way to send email:<span class="Apple-converted-space"> </span><br>
<br>
private void send(UserModel user,
AuthenticationFlowContext context, String subject,
String textBody, String htmlBody) throws EmailException
{<br>
try {<br>
String address = user.getEmail();<br>
Map<String, String> config =
context.getRealm().getSmtpConfig();<br>
<br>
Properties props = new Properties();<br>
props.setProperty("mail.smtp.host",
config.get("host"));<br>
<br>
boolean auth =
"true".equals(config.get("auth"));<br>
boolean ssl =
"true".equals(config.get("ssl"));<br>
boolean starttls =
"true".equals(config.get("starttls"));<br>
<br>
if (config.containsKey("port")) {<br>
props.setProperty("mail.smtp.port",
config.get("port"));<br>
}<br>
<br>
if (auth) {<br>
props.put("mail.smtp.auth", "true");<br>
}<br>
<br>
if (ssl) {<br>
props.put("mail.smtp.socketFactory.port",
config.get("port"));<br>
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");<br>
}<br>
<br>
if (starttls) {<br>
props.put("mail.smtp.starttls.enable",
"true");<br>
}<br>
<br>
String from = config.get("from");<br>
<br>
Session session =
Session.getInstance(props);<br>
<br>
Multipart multipart = new
MimeMultipart("alternative");<br>
<br>
if (textBody != null) {<br>
MimeBodyPart textPart = new
MimeBodyPart();<br>
textPart.setText(textBody, "UTF-8");<br>
multipart.addBodyPart(textPart);<br>
}<br>
<br>
if (htmlBody != null) {<br>
MimeBodyPart htmlPart = new
MimeBodyPart();<br>
htmlPart.setContent(htmlBody,
"text/html; charset=UTF-8");<br>
multipart.addBodyPart(htmlPart);<br>
}<br>
<br>
Message msg = new MimeMessage(session);<br>
msg.setFrom(new InternetAddress(from));<br>
msg.setHeader("To", address);<br>
msg.setSubject(subject);<br>
msg.setContent(multipart);<br>
msg.saveChanges();<br>
msg.setSentDate(new Date());<br>
<br>
Transport transport =
session.getTransport("smtp");<br>
if (auth) {<br>
transport.connect(config.get("user"),
config.get("password"));<br>
} else {<br>
transport.connect();<br>
}<br>
transport.sendMessage(msg, new
InternetAddress[]{new InternetAddress(address)});<br>
} catch (Exception e) {<br>
throw new EmailException(e);<br>
}<br>
}<br>
<br>
connect/auth<br>
<br>
JBWEB000309: type JBWEB000066: Exception report<br>
<br>
JBWEB000068: message request path:
/auth/realms/MYAPP/protocol/openid-connect/auth<br>
<br>
JBWEB000069: description JBWEB000145: The server
encountered an internal error that prevented it from
fulfilling this request.<br>
<br>
JBWEB000070: exception<br>
<br>
java.lang.RuntimeException: request path:
/auth/realms/MYAPP/protocol/openid-connect/auth<br>
org.keycloak.services.filters.KeycloakSessionServletFilter.doFilter(KeycloakSessionServletFilter.java:75)<br>
JBWEB000071: root cause<br>
<br>
org.jboss.resteasy.spi.UnhandledException:
java.lang.NoClassDefFoundError: javax/mail/Multipart<br>
org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:364)<br>
org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:232)<br>
org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:208)<br>
org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:556)<br>
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:523)<br>
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:125)<br>
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)<br>
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)<br>
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)<br>
org.keycloak.services.filters.KeycloakSessionServletFilter.doFilter(KeycloakSessionServletFilter.java:61)<br>
JBWEB000071: root cause<br>
<br>
java.lang.NoClassDefFoundError: javax/mail/Multipart<br>
de.MYAPP.auth.authenticator.MYAPPEmailAuthenticatorFactory.create(MYAPPEmailAuthenticatorFactory.java:27)<br>
de.MYAPP.auth.authenticator.MYAPPEmailAuthenticatorFactory.create(MYAPPEmailAuthenticatorFactory.java:19)<br>
org.keycloak.authentication.DefaultAuthenticationFlow.processFlow(DefaultAuthenticationFlow.java:124)<br>
org.keycloak.authentication.DefaultAuthenticationFlow.processFlow(DefaultAuthenticationFlow.java:97)<br>
org.keycloak.authentication.AuthenticationProcessor.authenticate(AuthenticationProcessor.java:650)<br>
org.keycloak.protocol.oidc.endpoints.AuthorizationEndpoint.browserAuthentication(AuthorizationEndpoint.java:315)<br>
org.keycloak.protocol.oidc.endpoints.AuthorizationEndpoint.buildAuthorizationCodeAuthorizationResponse(AuthorizationEndpoint.java:265)<br>
org.keycloak.protocol.oidc.endpoints.AuthorizationEndpoint.build(AuthorizationEndpoint.java:123)<br>
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)<br>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<br>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
java.lang.reflect.Method.invoke(Method.java:606)<br>
org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:168)<br>
org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269)<br>
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227)<br>
org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:158)<br>
org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:106)<br>
org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:153)<br>
org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:91)<br>
org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:541)<br>
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:523)<br>
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:125)<br>
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)<br>
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)<br>
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)<br>
org.keycloak.services.filters.KeycloakSessionServletFilter.doFilter(KeycloakSessionServletFilter.java:61)<br>
JBWEB000071: root cause<br>
<br>
java.lang.ClassNotFoundException: javax.mail.Multipart<br>
java.net.URLClassLoader$1.run(URLClassLoader.java:366)<br>
java.net.URLClassLoader$1.run(URLClassLoader.java:355)<br>
java.security.AccessController.doPrivileged(Native
Method)<br>
java.net.URLClassLoader.findClass(URLClassLoader.java:354)<br>
java.lang.ClassLoader.loadClass(ClassLoader.java:425)<br>
java.lang.ClassLoader.loadClass(ClassLoader.java:358)<br>
de.MYAPP.auth.authenticator.MYAPPEmailAuthenticatorFactory.create(MYAPPEmailAuthenticatorFactory.java:27)<br>
de.MYAPP.auth.authenticator.MYAPPEmailAuthenticatorFactory.create(MYAPPEmailAuthenticatorFactory.java:19)<br>
org.keycloak.authentication.DefaultAuthenticationFlow.processFlow(DefaultAuthenticationFlow.java:124)<br>
org.keycloak.authentication.DefaultAuthenticationFlow.processFlow(DefaultAuthenticationFlow.java:97)<br>
org.keycloak.authentication.AuthenticationProcessor.authenticate(AuthenticationProcessor.java:650)<br>
org.keycloak.protocol.oidc.endpoints.AuthorizationEndpoint.browserAuthentication(AuthorizationEndpoint.java:315)<br>
org.keycloak.protocol.oidc.endpoints.AuthorizationEndpoint.buildAuthorizationCodeAuthorizationResponse(AuthorizationEndpoint.java:265)<br>
org.keycloak.protocol.oidc.endpoints.AuthorizationEndpoint.build(AuthorizationEndpoint.java:123)<br>
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)<br>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)<br>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)<br>
java.lang.reflect.Method.invoke(Method.java:606)<br>
org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:168)<br>
org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269)<br>
org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227)<br>
org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:158)<br>
org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:106)<br>
org.jboss.resteasy.core.ResourceLocator.invokeOnTargetObject(ResourceLocator.java:153)<br>
org.jboss.resteasy.core.ResourceLocator.invoke(ResourceLocator.java:91)<br>
org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:541)<br>
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:523)<br>
org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:125)<br>
org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208)<br>
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55)<br>
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50)<br>
javax.servlet.http.HttpServlet.service(HttpServlet.java:847)<br>
org.keycloak.services.filters.KeycloakSessionServletFilter.doFilter(KeycloakSessionServletFilter.java:61)<br>
<br>
<div class="yiv9319221611moz-cite-prefix" id="yui_3_16_0_1_1447861079041_124744">Am 23.11.15 um
13:32 schrieb Ataraxus:<br>
</div>
<blockquote type="cite" id="yui_3_16_0_1_1447861079041_124688" style="margin:
1em; display: block;">
<pre id="yui_3_16_0_1_1447861079041_124687" style="font-family: 'Courier New'; margin: 1em 0px; display: block; white-space: pre-wrap;">Hey,
I'm writing my custum login provider which works great so far, but i
stumbled upon a dependency issue:
I wan't to use mail in my authenticator, but when the authenticator gets
actually loaded I get an class not found exception.
Somehow is java.mail.* not available in the classpath of providers which
are dropped in the configuration/providers path.
How can i use these dependencies? I could include them into my jar, but
i guess thats not the "right" way.
Thanks
_______________________________________________
keycloak-user mailing list
<a rel="nofollow" class="yiv9319221611moz-txt-link-abbreviated" ymailto="mailto:keycloak-user@lists.jboss.org" target="_blank" href="mailto:keycloak-user@lists.jboss.org" style="margin: 0px; padding: 0px; text-decoration: underline !important; color: blue; outline: none; cursor: text !important; background: transparent;">keycloak-user@lists.jboss.org</a>
<a rel="nofollow" class="yiv9319221611moz-txt-link-freetext" target="_blank" href="https://lists.jboss.org/mailman/listinfo/keycloak-user" style="margin: 0px; padding: 0px; text-decoration: underline !important; color: blue; outline: none; cursor: text !important; background: transparent;">https://lists.jboss.org/mailman/listinfo/keycloak-user</a>
</pre>
</blockquote>
<br>
</div>
</div>
<br>
</div>
</div>
</div>
</blockquote>
</body>
</html>