<div dir="ltr"><div><div><div><div><div><div><div>Hi There,<br><br></div>i try to use Keycloak to authenticate an EJB Remote Client Call.<br></div><br></div>Setup: <br></div>I have a working Keycloak Setup for my WebClients. <br></div>I add to my application server standalone.xml an additional security domain:<br><br> <security-domain name="keycloakjaas" cache-type="default"><br> <authentication><br> <login-module code="org.keycloak.adapters.jaas.DirectAccessGrantsLoginModule" flag="required"><br> <module-option name="keycloak-config-file" value="E:\Software\ApplicationServer\wildfly-10.0.0.Final\standalone\configuration\keycloak-sso1.json"/><br> </login-module><br> </authentication><br> </security-domain><br><br><br></div>and configure my ejb sub-system<br> <subsystem xmlns="urn:jboss:domain:ejb3:4.0"><br> ....<br> <default-security-domain value="keycloakjaas"/><br> </subsystem><br><br><br></div><div>My Test Connection:<br> prop.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");<br> prop.put(Context.PROVIDER_URL, "http-remoting://localhost:8080");<br> prop.put("jboss.naming.client.ejb.context", true);<br> prop.put(Context.SECURITY_PRINCIPAL, "admin-user");<br> prop.put(Context.SECURITY_CREDENTIALS, "123");<br><br></div><div>fails with: "Invalid User" <br><br></div><div>In Keycloak Server i see the failed login:<br>Errorinvalid_user_credentials
<br>
auth_method
openid-connect
grant_type
password
client_auth_method
client-secret
username
admin-user<br><br>"Direct Access Grants" is enabeld for that application.<br><br></div><div>Somebody any idea? Or is my setup totally wrong?<br></div><div>How whould i use KeyCloak for remote EJB calls?<br></div><div><br></div><div>Thanks a lot<br></div>Chris</div>