--
You received this message because you are subscribed to a topic in the Google Groups "WildFly" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/wildfly/8f5AAcoU7HY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/c5cbbf49-417a-46dc-ac94-cd550119fff6n%40googlegroups.com.
As a first step I am passing in the user credentials in the wildfly-gonfig.xml(haven´t found any good example of how to set them though):
configuration>
<authentication-client xmlns="urn:elytron:1.0">
<authentication-rules>
<rule use-configuration="ldapAuthConfig"/>
</authentication-rules>
<authentication-configurations>
<configuration name="ldapAuthConfig">
<sasl-mechanism-selector selector="DIGEST-MD5"/>
<set-authorization-name name="myPrincipal"/>
<set-user-name name="myPrincipal" />
<credentials>
<clear-password password="myPassword" />
</credentials>
<set-mechanism-realm name="CachedLdapRealm" />
</configuration>
</authentication-configurations>
</authentication-client>
</configuration>
My intention if I do get this to work is to configure this programatically with AuthenticationConfiguration and AuthenticationContext and set the user credentials dynamically.
2022-02-23 12:01:22,196 TRACE [org.wildfly.security] (default task-1) Handling RealmCallback: selected = [CachedLdapRealm]
2022-02-23 12:01:22,197 TRACE [org.wildfly.security] (default task-1) Handling NameCallback: authenticationName = myPrincipal
2022-02-23 12:01:22,198 TRACE [org.wildfly.security] (default task-1) Principal assigning: [myPrincipal], pre-realm rewritten: [myPrincipal], realm name: [CachedLdapRealm], post-realm rewritten: [myPrincipal], realm rewritten: [myPrincipal]
2022-02-23 12:01:22,198 DEBUG [org.wildfly.security] (default task-1) Obtaining lock for identity [myPrincipal]...
2022-02-23 12:01:22,198 DEBUG [org.wildfly.security] (default task-1) Obtained lock for identity [myPrincipal].
2022-02-23 12:01:22,202 DEBUG [org.wildfly.security] (default task-1) Creating [class javax.naming.directory.InitialDirContext] with environment:
2022-02-23 12:01:22,202 DEBUG [org.wildfly.security] (default task-1) Property [java.naming.security.credentials] with value [******]
2022-02-23 12:01:22,202 DEBUG [org.wildfly.security] (default task-1) Property [java.naming.security.authentication] with value [simple]
2022-02-23 12:01:22,202 DEBUG [org.wildfly.security] (default task-1) Property [java.naming.provider.url] with value [ldap://myad:389]
2022-02-23 12:01:22,202 DEBUG [org.wildfly.security] (default task-1) Property [com.sun.jndi.ldap.read.timeout] with value [60000]
2022-02-23 12:01:22,202 DEBUG [org.wildfly.security] (default task-1) Property [com.sun.jndi.ldap.connect.pool] with value [false]
2022-02-23 12:01:22,202 DEBUG [org.wildfly.security] (default task-1) Property [com.sun.jndi.ldap.connect.timeout] with value [5000]
2022-02-23 12:01:22,202 DEBUG [org.wildfly.security] (default task-1) Property [java.naming.security.principal] with value [myPrincipal]
2022-02-23 12:01:22,202 DEBUG [org.wildfly.security] (default task-1) Property [java.naming.referral] with value [ignore]
2022-02-23 12:01:22,203 DEBUG [org.wildfly.security] (default task-1) Property [java.naming.factory.initial] with value [com.sun.jndi.ldap.LdapCtxFactory]
2022-02-23 12:01:22,294 DEBUG [org.wildfly.security] (default task-1) [javax.naming.ldap.InitialLdapContext@283c9bf6] successfully created. Connection established to LDAP server.
2022-02-23 12:01:22,295 DEBUG [org.wildfly.security] (default task-1) Trying to create identity for principal [myPrincipal].
2022-02-23 12:01:22,296 DEBUG [org.wildfly.security] (default task-1) Executing search [(sAMAccountName={0})] in context [ou=Users,ou=ad,dc=ad,dc=my,dc=se] with arguments [myPrincipal]. Returning attributes are [null]. Binary attributes are [null].
Nevermind the dysfunctional search, I haven´t looked into that yet but the important part is that I was allowed to search at all.
2022-02-23 12:42:54,992 DEBUG [org.wildfly.security] (default task-1) [javax.naming.ldap.InitialLdapContext@548b2bdc] successfully created. Connection established to LDAP server.
2022-02-23 12:42:55,058 TRACE [org.wildfly.security.sasl.digest] (default task-1) SASL Negotiation Failed
2022-02-23 12:42:55,059 TRACE [org.jboss.remoting.remote.server] (default task-1) Server sending authentication rejected: javax.security.sasl.SaslException: ELY05053: Callback handler failed for unknown reason [Caused by java.io.IOException: org.wildfly.security.auth.server.RealmUnavailableException: ELY01125: Ldap-backed realm failed to obtain context]
...
Caused by: javax.naming.NamingException: [LDAP: error code 1 - 000004DC: LdapErr: DSID-0C0907E9, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, v2580]; remaining name ''
So basically the same as I would get through ldapsearch with incorrect credentials. I was expecting the credentials I provided in the client would be used to bind with direct-verification="true". Need to get this to work in production or quickly think of another security solution.
I may definitely have configured this wrong but given I found this thread perhaps I am not? Would much appreciate any pointers towards a solution.
You received this message because you are subscribed to the Google Groups "WildFly" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wildfly+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wildfly/dd80b0e6-b31e-41cd-ae69-d2123c354960n%40googlegroups.com.