Re: [JBoss-user] Client Access to JBoss EJBs

2003-07-29 Thread Christofer Dutz
No I didn't. I only used the everyone role.
I think that way I don'r have to specify the Administrator role.
I only used this, so I could play a little with everything, when I get 
everything to work.

chris

Wolfgang Helbig wrote:

Did you specify the role "Administrator" in the assembly descriptor
of your bean? Something like this:
	...
	
   Administrator
   Administrator
   

   
   Administrator
   
   barEJB
   *
   
   ...


Or if you want methods to be accessed w/o permissions, you need to
specify it like this:
	...
   
   
   
   fooEJB
   *
   
   
   ...
 





---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Re: [JBoss-user] Client Access to JBoss EJBs

2003-07-28 Thread Wolfgang Helbig
Did you specify the role "Administrator" in the assembly descriptor
of your bean? Something like this:
...

Administrator
Administrator



Administrator

barEJB
*

...



Or if you want methods to be accessed w/o permissions, you need to
specify it like this:
...



fooEJB
*


...


>java.rmi.ServerException: RemoteException occurred in server thread; 
>nested exception is:
>java.rmi.ServerException: EJBException:; nested exception is:
>javax.ejb.EJBException: checkSecurityAssociation; CausedByException is:
>Authentication exception, principal=testUser
>at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)
>
>It seems I havn't got the
>server side configured correctly. I configured my Beans to use the 
>java:/jaas/test Security-Domain
>and configured a part in login-config.xml that looks like this:
>
>
>
>code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">
>name="unauthenticatedIdentity">guest
>
>
>
>I created the two files users.properties and roles.properties in the 
>jboss/server/default/conf directory with th folowing content:
>
>roles.properties:
>testUser=everyone,Administrator
>guest=everyone
>
>users.properties:
>testUser=testPassword
>
>As far as I can understand it. Any user should be in the role "everyone" 
>the user I used for login should aditionaly be in the role "Administrator".
>Do you see any errors here ?
>
>Chris
>
>Nicholas wrote:
>
>>E
>>
>>I am going to take a guess and say that
>>"Anmeldekonfiguration kann nicht gefunden" means that
>>the auth.conf file could not be found.
>>
>>What did you set your java.security.auth.login.config
>>system property to ? Are you sure the file can be
>>found there ?
>>
>>//Nicholas
>>  
>>
>
>
>
>
>---
>This SF.Net email sponsored by: Free pre-built ASP.NET sites including
>Data Reports, E-commerce, Portals, and Forums are available now.
>Download today and enter to win an XBOX or Visual Studio .NET.
>http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
>___
>JBoss-user mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/jboss-user



---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Re: [JBoss-user] Client Access to JBoss EJBs

2003-07-28 Thread Christofer Dutz
I finaly managed the client to find the jaas.conf file I created. Now 
the execution of the login-method doesn't throw
any exceptions anymore. As far as I could get this. I havn't realy 
authenticated myself at this moment. Authentication
is simply delayed untill I do my first call to a resource of JBoss.

I now was able to successfully retrieve a home-interface of one of my 
session-beans.
After calling the create-method I get the folowing Exception.

java.rmi.ServerException: RemoteException occurred in server thread; 
nested exception is:
   java.rmi.ServerException: EJBException:; nested exception is:
   javax.ejb.EJBException: checkSecurityAssociation; CausedByException is:
   Authentication exception, principal=testUser
   at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:292)

It seems I havn't got the
server side configured correctly. I configured my Beans to use the 
java:/jaas/test Security-Domain
and configured a part in login-config.xml that looks like this:

   
   
   
   guest
   
   

I created the two files users.properties and roles.properties in the 
jboss/server/default/conf directory with th folowing content:

roles.properties:
testUser=everyone,Administrator
guest=everyone
users.properties:
testUser=testPassword
As far as I can understand it. Any user should be in the role "everyone" 
the user I used for login should aditionaly be in the role "Administrator".
Do you see any errors here ?

Chris

Nicholas wrote:

E

I am going to take a guess and say that
"Anmeldekonfiguration kann nicht gefunden" means that
the auth.conf file could not be found.
What did you set your java.security.auth.login.config
system property to ? Are you sure the file can be
found there ?
//Nicholas
 





---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Re: [JBoss-user] Client Access to JBoss EJBs

2003-07-28 Thread Nicholas
E

I am going to take a guess and say that
"Anmeldekonfiguration kann nicht gefunden" means that
the auth.conf file could not be found.

What did you set your java.security.auth.login.config
system property to ? Are you sure the file can be
found there ?

//Nicholas




--- Christofer Dutz <[EMAIL PROTECTED]> wrote:
> Thanks for your reply. Unfortunately I get the same
> error I got from
> other tries:
> 
> java.lang.SecurityException: Anmeldekonfiguration
> kann nicht gefunden
> werden.
> at
>
com.sun.security.auth.login.ConfigFile.(ConfigFile.java:97)
> at
>
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
> Method)
> at
>
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at
>
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at
>
java.lang.reflect.Constructor.newInstance(Constructor.java:274)
> at java.lang.Class.newInstance0(Class.java:306)
> at java.lang.Class.newInstance(Class.java:259)
> at
>
javax.security.auth.login.Configuration$3.run(Configuration.java:221)
> at
> java.security.AccessController.doPrivileged(Native
> Method)
> at
>
javax.security.auth.login.Configuration.getConfiguration(Configuration.java:215)
> at
>
javax.security.auth.login.LoginContext$1.run(LoginContext.java:170)
> at
> java.security.AccessController.doPrivileged(Native
> Method)
> at
>
javax.security.auth.login.LoginContext.init(LoginContext.java:167)
> at
>
javax.security.auth.login.LoginContext.(LoginContext.java:404)
> at
>
org.jboss.security.jndi.LoginInitialContextFactory.getInitialContext(LoginInitialContextFactory.java:58)
> at
>
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
> at
>
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
> at
>
javax.naming.InitialContext.init(InitialContext.java:219)
> at
>
javax.naming.InitialContext.(InitialContext.java:195)
> at
>
de.cware.cweb.client.TestClient.main(TestClient.java:40)
> Caused by: java.io.IOException: Anmeldekonfiguration
> kann nicht gefunden
> werden.
> at
>
com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:206)
> at
>
com.sun.security.auth.login.ConfigFile.(ConfigFile.java:95)
> ... 19 more
> 
> What am I doing wrong. It seems It is no problem to
> access JBoss from
> clients like Web-Client.
> But what do I have to do to get the normaly external
> Java-App to work ?
> 
> Chris
> 
> 
> Nicholas wrote:
> 
> >Your simple client should have code that looks up
> the
> >JNDI context using the LoginInitialContextFactory.
> >
> >Something like this:
> >
> >  public Context login(String user, String
> password) {
> >try {
> >  Context ctx = null;
> >  Properties p = new Properties();
> >  p.put(Context.PROVIDER_URL, "yourhost:1099");
> >  p.put(Context.INITIAL_CONTEXT_FACTORY,
> >   
>
>"org.jboss.security.jndi.LoginInitialContextFactory");
> >  p.put(Context.URL_PKG_PREFIXES,
> >"org.jboss.naming:org.jnp.interfaces");
> >  p.put(Context.SECURITY_PROTOCOL, "login");
> >  p.put(Context.SECURITY_PRINCIPAL, user);
> >  p.put(Context.SECURITY_CREDENTIALS,
> password);
> >  ctx = new InitialContext(p);
> >  return ctx;
> >}
> >
> >When you run your cliemt, set the following system
> >property:
> >
> >java.security.auth.login.config= TO
> >auth.conf>
> >
> >eg.
> >
> >http://MYHOST:8080/security-conf/auth.conf
> >
> >The auth.conf file looks like this:
> >
> >login {
> > org.jboss.security.ClientLoginModule required;
> >};
> >other {
> > org.jboss.security.ClientLoginModule required;
> >};
> >
> >
> >So the line
> >  p.put(Context.SECURITY_PROTOCOL, "login");
> >
> >refers to the entry in the auth.conf file.
> >
> >Hopefully, that will sort you out.
> >
> >//Nicholas
> >  
> >
> 
> 
> 
> 
> 
> 
> 
>
---
> This SF.Net email sponsored by: Free pre-built
> ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are
> available now.
> Download today and enter to win an XBOX or Visual
> Studio .NET.
>
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
>
https://lists.sourceforge.net/lists/listinfo/jboss-user


=
Nicholas Whitehead
Home: (973) 377 9335
Cell: (201) 615 2716
[EMAIL PROTECTED]
Get Your News From The Crowbar: http://crowbar.dnsalias.com:443/crowbar/


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
JBoss-user mailing list
[EMAIL PR

Re: [JBoss-user] Client Access to JBoss EJBs

2003-07-28 Thread Christofer Dutz
Thanks for your reply. Unfortunately I get the same error I got from
other tries:
java.lang.SecurityException: Anmeldekonfiguration kann nicht gefunden
werden.
   at com.sun.security.auth.login.ConfigFile.(ConfigFile.java:97)
   at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
   at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
   at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
   at java.lang.Class.newInstance0(Class.java:306)
   at java.lang.Class.newInstance(Class.java:259)
   at javax.security.auth.login.Configuration$3.run(Configuration.java:221)
   at java.security.AccessController.doPrivileged(Native Method)
   at
javax.security.auth.login.Configuration.getConfiguration(Configuration.java:215)
   at javax.security.auth.login.LoginContext$1.run(LoginContext.java:170)
   at java.security.AccessController.doPrivileged(Native Method)
   at javax.security.auth.login.LoginContext.init(LoginContext.java:167)
   at javax.security.auth.login.LoginContext.(LoginContext.java:404)
   at
org.jboss.security.jndi.LoginInitialContextFactory.getInitialContext(LoginInitialContextFactory.java:58)
   at
javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:662)
   at
javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:243)
   at javax.naming.InitialContext.init(InitialContext.java:219)
   at javax.naming.InitialContext.(InitialContext.java:195)
   at de.cware.cweb.client.TestClient.main(TestClient.java:40)
Caused by: java.io.IOException: Anmeldekonfiguration kann nicht gefunden
werden.
   at com.sun.security.auth.login.ConfigFile.init(ConfigFile.java:206)
   at com.sun.security.auth.login.ConfigFile.(ConfigFile.java:95)
   ... 19 more
What am I doing wrong. It seems It is no problem to access JBoss from
clients like Web-Client.
But what do I have to do to get the normaly external Java-App to work ?
Chris

Nicholas wrote:

Your simple client should have code that looks up the
JNDI context using the LoginInitialContextFactory.
Something like this:

 public Context login(String user, String password) {
   try {
 Context ctx = null;
 Properties p = new Properties();
 p.put(Context.PROVIDER_URL, "yourhost:1099");
 p.put(Context.INITIAL_CONTEXT_FACTORY,
  
"org.jboss.security.jndi.LoginInitialContextFactory");
 p.put(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
 p.put(Context.SECURITY_PROTOCOL, "login");
 p.put(Context.SECURITY_PRINCIPAL, user);
 p.put(Context.SECURITY_CREDENTIALS, password);
 ctx = new InitialContext(p);
 return ctx;
}

When you run your cliemt, set the following system
property:
java.security.auth.login.config=
eg.

http://MYHOST:8080/security-conf/auth.conf

The auth.conf file looks like this:

login {
org.jboss.security.ClientLoginModule required;
};
other {
org.jboss.security.ClientLoginModule required;
};
So the line
 p.put(Context.SECURITY_PROTOCOL, "login");
refers to the entry in the auth.conf file.

Hopefully, that will sort you out.

//Nicholas
 







---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


Re: [JBoss-user] Client Access to JBoss EJBs

2003-07-27 Thread Nicholas
Your simple client should have code that looks up the
JNDI context using the LoginInitialContextFactory.

Something like this:

  public Context login(String user, String password) {
try {
  Context ctx = null;
  Properties p = new Properties();
  p.put(Context.PROVIDER_URL, "yourhost:1099");
  p.put(Context.INITIAL_CONTEXT_FACTORY,
   
"org.jboss.security.jndi.LoginInitialContextFactory");
  p.put(Context.URL_PKG_PREFIXES,
"org.jboss.naming:org.jnp.interfaces");
  p.put(Context.SECURITY_PROTOCOL, "login");
  p.put(Context.SECURITY_PRINCIPAL, user);
  p.put(Context.SECURITY_CREDENTIALS, password);
  ctx = new InitialContext(p);
  return ctx;
}

When you run your cliemt, set the following system
property:

java.security.auth.login.config=

eg.

http://MYHOST:8080/security-conf/auth.conf

The auth.conf file looks like this:

login {
org.jboss.security.ClientLoginModule required;
};
other {
org.jboss.security.ClientLoginModule required;
};


So the line
  p.put(Context.SECURITY_PROTOCOL, "login");

refers to the entry in the auth.conf file.

Hopefully, that will sort you out.

//Nicholas


--- Christofer Dutz <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> at the moment I am learning for an exam on tuesday
> and am realy sort of
> frustrated.
> I finaly managed to understand using  XDoclet and
> simply wanted to try
> to access my Beans from a simple Client.
> Now something has to have changed since earlier
> JBoss versions (I am
> using 3.2.2RC2)
> 
> How can I authenticate a simple client application
> in a seperate VM so I
> can acces my EJBs.
> I have tried googeling for a solution, but that only
> made things worse.
> It seems impossible to find up-to-date information.
> All hints turned out
> to be wrong.
> 
> Could someone please send me a link on how to write
> a client to
> correctly authenticate with the JAAS-Service of
> JBoss ?
> 
> Thanx in advance,
> Chris
> 
> 
> 
> 
> 
>
---
> This SF.Net email sponsored by: Free pre-built
> ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are
> available now.
> Download today and enter to win an XBOX or Visual
> Studio .NET.
>
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
> ___
> JBoss-user mailing list
> [EMAIL PROTECTED]
>
https://lists.sourceforge.net/lists/listinfo/jboss-user


=
Nicholas Whitehead
Home: (973) 377 9335
Cell: (201) 615 2716
[EMAIL PROTECTED]
Get Your News From The Crowbar: http://crowbar.dnsalias.com:443/crowbar/


---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user


[JBoss-user] Client Access to JBoss EJBs

2003-07-27 Thread Christofer Dutz
Hi,

at the moment I am learning for an exam on tuesday and am realy sort of
frustrated.
I finaly managed to understand using  XDoclet and simply wanted to try
to access my Beans from a simple Client.
Now something has to have changed since earlier JBoss versions (I am
using 3.2.2RC2)
How can I authenticate a simple client application in a seperate VM so I
can acces my EJBs.
I have tried googeling for a solution, but that only made things worse.
It seems impossible to find up-to-date information. All hints turned out
to be wrong.
Could someone please send me a link on how to write a client to
correctly authenticate with the JAAS-Service of JBoss ?
Thanx in advance,
   Chris




---
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa0013ave/direct;at.aspnet_072303_01/01
___
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user