[Security & JAAS/JBoss] - LDAP Authendication & Authorization
by manogaranyuvaraj
Hi
I need some idea to configure the LDAP. I have the users & the roles in LDAP server. I can able to validate the role, but i can authenticate with the username & password. I think i have made some wrong thing.
Here my Configuration.
<application-policy name="jmx-console">
<login-module code="org.jboss.security.auth.spi.LdapLoginModule" flag="required">
<module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option>
<module-option name="java.naming.provider.url">ldap://ldaphost.abc.com:7992/</module-option>
<module-option name="java.naming.security.authentication">simple</module-option>
<module-option name="principalDNPrefix">uid=</module-option>
<module-option name="uidAttributeID">uniquemember</module-option>
<module-option name="matchOnUserDN">true</module-option>
<module-option name="roleAttributeID">cn</module-option>
<module-option name="roleAttributeIsID">false</module-option>
<module-option name="principalDNSuffix">,ou=People,dc=abc,dc=com</module-option>
<module-option name="rolesCtxDN">ou=Roles,du=abc,dc=com</module-option>
</login-module>
</application-policy>
Roles & users structure in LDAP
# entry-id: 64
dn: cn=JBossAdmin,ou=Roles,dc=abc,dc=com
objectClass: top
objectClass: groupofuniquenames
creatorsName: uid=admin,ou=administrators,ou=topologymanagement,o=netscaperoot
createTimestamp: 20061024132211Z
nsUniqueId: 8e207c01-1dd211b2-80c8e8b0-30c2eb27
uniqueMember: uid=emendez,ou=People,dc=gmacinsurance,dc=com
uniqueMember: uid=jsadler,ou=People,dc=gmacinsurance,dc=com
uniqueMember: uid=pabeln,ou=People,dc=gmacinsurance,dc=com
uniqueMember: uid=ymano,ou=People,dc=gmacinsurance,dc=com
cn: JBossAdmin
# entry-id: 65
dn: cn=HttpInvoker,ou=Roles,dc=abc,dc=com
objectClass: top
objectClass: groupofuniquenames
cn: HttpInvoker
creatorsName: uid=admin,ou=administrators,ou=topologymanagement,o=netscaperoot
createTimestamp: 20061024141154Z
nsUniqueId: 8a442801-1dd211b2-80cfe8b0-30c2eb27
uniqueMember: uid=emendez,ou=People,dc=abc,dc=com
uniqueMember: uid=jsadler,ou=People,dc=abc,dc=com
uniqueMember: uid=pabeln,ou=People,dc=abc,dc=com
uniqueMember: uid=ymano,ou=People,dc=abc,dc=com
Any Idea.....
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980398#3980398
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980398
19 years, 6 months
[Security & JAAS/JBoss] - Re: JAAS/LDAP Roles configuration pulls superset instead of
by manogaranyuvaraj
Hi
I need some idea to configure the LDAP. I have the users & the roles in LDAP server. I can able to validate the role, but i can authenticate with the username & password. I think i have made some wrong thing.
Here my Configuration.
<application-policy name="jmx-console">
<login-module code="org.jboss.security.auth.spi.LdapLoginModule" flag="required">
<module-option name="java.naming.factory.initial">com.sun.jndi.ldap.LdapCtxFactory</module-option>
<module-option name="java.naming.provider.url">ldap://ldaphost.abc.com:7992/</module-option>
<module-option name="java.naming.security.authentication">simple</module-option>
<module-option name="principalDNPrefix">uid=</module-option>
<module-option name="uidAttributeID">uniquemember</module-option>
<module-option name="matchOnUserDN">true</module-option>
<module-option name="roleAttributeID">cn</module-option>
<module-option name="roleAttributeIsID">false</module-option>
<module-option name="principalDNSuffix">,ou=People,dc=abc,dc=com</module-option>
<module-option name="rolesCtxDN">ou=Roles,du=abc,dc=com</module-option>
</login-module>
</application-policy>
Roles & users structure in LDAP
# entry-id: 64
dn: cn=JBossAdmin,ou=Roles,dc=abc,dc=com
objectClass: top
objectClass: groupofuniquenames
creatorsName: uid=admin,ou=administrators,ou=topologymanagement,o=netscaperoot
createTimestamp: 20061024132211Z
nsUniqueId: 8e207c01-1dd211b2-80c8e8b0-30c2eb27
uniqueMember: uid=emendez,ou=People,dc=gmacinsurance,dc=com
uniqueMember: uid=jsadler,ou=People,dc=gmacinsurance,dc=com
uniqueMember: uid=pabeln,ou=People,dc=gmacinsurance,dc=com
uniqueMember: uid=ymano,ou=People,dc=gmacinsurance,dc=com
cn: JBossAdmin
# entry-id: 65
dn: cn=HttpInvoker,ou=Roles,dc=abc,dc=com
objectClass: top
objectClass: groupofuniquenames
cn: HttpInvoker
creatorsName: uid=admin,ou=administrators,ou=topologymanagement,o=netscaperoot
createTimestamp: 20061024141154Z
nsUniqueId: 8a442801-1dd211b2-80cfe8b0-30c2eb27
uniqueMember: uid=emendez,ou=People,dc=abc,dc=com
uniqueMember: uid=jsadler,ou=People,dc=abc,dc=com
uniqueMember: uid=pabeln,ou=People,dc=abc,dc=com
uniqueMember: uid=ymano,ou=People,dc=abc,dc=com
Any Idea.....
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980394#3980394
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980394
19 years, 6 months
[JBossWS] - web services client
by koriel
I want to implement a user authentication service using web services..so I have these classes
| package server.webservices;
|
| import javax.ejb.Local;
| import javax.ejb.Remote;
|
| @Local
| @Remote
| public interface LoginService
| {
| public boolean Authenticate(String userid,String passid);
| }
|
| package server.webservices;
|
| import javax.ejb.Local;
| import javax.ejb.Remote;
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
|
|
| @Stateless
| @Local( { LoginService.class } )
| @Remote( { LoginService.class } )
|
| @WebService(name = "LoginService",
| serviceName = "LoginService",
| endpointInterface = "server.webservices.LoginServiceSEI"
| )
| public class LoginServiceBean implements LoginService
| {
|
| @WebMethod
| public boolean Authenticate(String userid, String passid)
| {
| //testing
| return true;
| }
|
|
| }
|
| package server.webservices;
|
| import java.rmi.Remote;
| import java.rmi.RemoteException;
|
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| import org.jboss.annotation.ejb.RemoteBinding;
| import org.jboss.ws.annotation.PortComponent;
|
| @WebService(name = "LoginService",
| serviceName = "LoginService"
| // See JSR-181 for exact details: http://jcp.org/aboutJava/communityprocess/mrel/jsr181/index.html
| )
|
| @SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
| use = SOAPBinding.Use.LITERAL,
| parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
|
| /*
| * BossWS propriatary annotations
| */
| @RemoteBinding(jndiBinding = "/ejb3/EJBLoginServiceSEI")
| @PortComponent(transportGuarantee="NONE",
| contextRoot = "/",
| urlPattern="/server/soap/LoginService")
| public interface LoginServiceSEI extends Remote
| {
|
|
| public boolean Authenticate(String userid,String passid) throws RemoteException;
| }
|
so I use wstools.sh to generate the client classes and I have four classes
| /*
| * JBossWS WS-Tools Generated Source
| *
| * Generation Date: Thu Oct 12 14:16:24 CEST 2006
| *
| * This generated source code represents a derivative work of the input to
| * the generator that produced it. Consult the input for the copyright and
| * terms of use that apply to this source code.
| */
|
| package client.webservices.client;
|
|
| public class Authenticate
| {
|
| protected java.lang.String string_1;
|
| protected java.lang.String string_2;
| public Authenticate(){}
|
| public Authenticate(java.lang.String string_1, java.lang.String string_2){
| this.string_1=string_1;
| this.string_2=string_2;
| }
| public java.lang.String getString_1() { return string_1 ;}
|
| public void setString_1(java.lang.String string_1){ this.string_1=string_1; }
|
| public java.lang.String getString_2() { return string_2 ;}
|
| public void setString_2(java.lang.String string_2){ this.string_2=string_2; }
|
| }
|
| /*
| * JBossWS WS-Tools Generated Source
| *
| * Generation Date: Thu Oct 12 14:16:24 CEST 2006
| *
| * This generated source code represents a derivative work of the input to
| * the generator that produced it. Consult the input for the copyright and
| * terms of use that apply to this source code.
| */
|
| package client.webservices.client;
|
| public class AuthenticateResponse
| {
|
| protected boolean result;
| public AuthenticateResponse(){}
|
| public AuthenticateResponse(boolean result){
| this.result=result;
| }
| public boolean isResult() { return result ;}
|
| public void setResult(boolean result){ this.result=result; }
|
| }
|
| /*
| * JBossWS WS-Tools Generated Source
| *
| * Generation Date: Thu Oct 12 14:16:24 CEST 2006
| *
| * This generated source code represents a derivative work of the input to
| * the generator that produced it. Consult the input for the copyright and
| * terms of use that apply to this source code.
| */
| package client.webservices.client;
| public interface LoginService_PortType extends java.rmi.Remote
| {
|
| public client.webservices.client.AuthenticateResponse authenticate(client.webservices.client.Authenticate authenticate) throws java.rmi.RemoteException;
| }
|
| /*
| * JBoss, the OpenSource EJB server
| * Distributable under LGPL license. See terms of license at gnu.org.
| */
|
| //Auto Generated by jbossws - Please do not edit!!!
|
| package client.webservices.client;
|
|
| import javax.xml.rpc.*;
|
|
| public interface LoginService_Service extends javax.xml.rpc.Service
| {
|
| public client.webservices.client.LoginService_PortType getLoginServicePort() throws ServiceException;
|
| }
|
so my question is how can I use those clients classes to implement a request in an ejb3.0 bean class. A small example would be great...
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980393#3980393
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980393
19 years, 6 months
[JCA/JBoss] - Re: Seemingly random connection issues?
by znbailey
"weston.price(a)jboss.com" wrote : There are effectively two distince states that the <new-connection-sql> and the <valid-connnection-sql> are designed to address. The former is in connection creation the latter is prior to a connection being handed out of the pool.
|
| The weird thing about your case is that it appears that the <new-connection-sql> has already been set being that the error you are seeing only happens on connection creation, and only in the event that the SQL statement cannot be executed.
Hi Weston,
Yeah, it is quite weird. It was my understanding that the new-connection-sql would help detect the case when a new connection was fouled up for whatever reason. Would it be possibly to turn on some debug/trace level logging to pinpoint exactly what is going on, or at least to try and get some more information?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3980390#3980390
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3980390
19 years, 6 months