Tomcat Valve Custom args

2013-04-01 Thread N.s.Karthik
Hi
 Spec:  

JDK1.6
Tomcat 6.0.26
O/s nix Suse


I have build a Customized Valve and have done the required  settings in
context.xml for specific APP
and have them returned variables System.println on console ( Catalina.out)

Question : 

1) How to get the return values  into a JSP file  [ using  request.  ]
of the specific APP
2) How to get the values only once and not per request of the users [
servlet Filters do this process ] 


with regards
KArthik  




--
View this message in context: 
http://tomcat.10.n6.nabble.com/Tomcat-Valve-Custom-args-tp4997226.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Valve Custom args

2013-04-01 Thread Michael-O

Am 2013-04-01 08:25, schrieb N.s.Karthik:

Hi
  Spec:

JDK1.6
Tomcat 6.0.26
O/s nix Suse


I have build a Customized Valve and have done the required  settings in
context.xml for specific APP
and have them returned variables System.println on console ( Catalina.out)

Question :

1) How to get the return values  into a JSP file  [ using  request.  ]
of the specific APP


What variables? What is APP?

Valves are invisible to the app. There are Tomcat-only. If you need to 
set some values, resort to environment entries through JNDI. A listener 
should do that. I have asked this recently on the mailing list.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Valve Custom args

2013-04-01 Thread N.s.Karthik
Hi

Thx for the reply

I know that Valves are invisible to the app.. 

Reason : 
I have created a Customized valve as a separate jar  used for AAA
interception of my APPS , 
Since I cannot configure each and every application hosted on the Tomcat
with filters  and hence created a Valve to apply this at Tomcat level 

I use the IWA (Integrated Window Authentication)  of IE / FFOx for Active
directory AAA Authentication.

On-sucessfull  AAA, in the valve  I need the variables such as
username/domain name  to be further  used with in each application  

Hence I need to know if any possibilities to fetch the variables  into each
of the applications from the valves ...???


with regards
Karthik  




--
View this message in context: 
http://tomcat.10.n6.nabble.com/Tomcat-Valve-Custom-args-tp4997226p4997235.html
Sent from the Tomcat - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Valve Custom args

2013-04-01 Thread Michael-O

Am 2013-04-01 14:28, schrieb N.s.Karthik:

Hi

Thx for the reply

I know that Valves are invisible to the app..

Reason :
I have created a Customized valve as a separate jar  used for AAA
interception of my APPS ,
Since I cannot configure each and every application hosted on the Tomcat
with filters  and hence created a Valve to apply this at Tomcat level

I use the IWA (Integrated Window Authentication)  of IE / FFOx for Active
directory AAA Authentication.

On-sucessfull  AAA, in the valve  I need the variables such as
username/domain name  to be further  used with in each application

Hence I need to know if any possibilities to fetch the variables  into each
of the applications from the valves ...???


I hope that you have implemented AuthenticatorBase in Tomcat with your 
custom Authenticator. With that you can register a Principal object.


I have written a fully-featured SPNEGO/AD Realm package which uses a 
custom ActiveDirectoryPrincipal extends Principal. In that I have stored 
distinguished name, objectSid, etc (source code available).


First, make the Principal#getName return either the Kerberos UPN, or if 
you use NTLM (yuck) return the legacy login name.


If your need access to further attributes do in your app:

MyCustomPrincipal principal = (MyCustomPrincipal) request.getPrincipal();

...access attributes.

That is the way to go.

Michael


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Valve Custom args

2013-04-01 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Karthik,

On 4/1/13 8:28 AM, N.s.Karthik wrote:
 Reason : I have created a Customized valve as a separate jar  used
 for AAA interception of my APPS , Since I cannot configure each and
 every application hosted on the Tomcat with filters  and hence
 created a Valve to apply this at Tomcat level
 
 I use the IWA (Integrated Window Authentication)  of IE / FFOx for
 Active directory AAA Authentication.
 
 On-sucessfull  AAA, in the valve  I need the variables such as 
 username/domain name  to be further  used with in each
 application
 
 Hence I need to know if any possibilities to fetch the variables
 into each of the applications from the valves ...???

Your valve can put anything you like into:

1. The request
2. The user's session
3. The application (context) scope

I recommend #1 or #2, depending upon your needs.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJRWYl7AAoJEBzwKT+lPKRYUW4QAKsbYLf2bZFiXhKn5vzkASoq
j2ggSc0jWA6fqwMgdBRmWd6ktL+4aouqfOF0aT47PuWgYOMVJZ1srMvbh4OQM6i6
8tLEJ/iE48cVqcTXw08TXKLUj5FztzG8+cQHxrFREKYu4UyrGAu7xSh6Z5cGPZCz
Q4VlwuBQ0tYOZRJoA8eIMwzR+RjMu1htmChrFxPJGv1yEPnEDnTy9lJkQ+KQ84j3
539jFH95sWOp7bPZVf0Qf1bqlUIxuf02I2VOVL/zmC91ri1fbCPwOwDXIcunz7Jd
v//GjLA5tBL2b6Qya+M5zHr34ZttyFEUcocesKHQDv+2Dq2ETrJoM4hHYis0Js+k
Mq+UU1ea9ApwaEIjNv19TMAlSV/Khj/fL5lR/dkwXjjWhF7DqzLIKyvNr2o5rozD
zNluZbJhqCpVTACPgl9E8QAdE5sk5aw6nySTcxWoLPupT1gWXLGx4WXRbl5dt2QZ
gDZltZr6+l5TT6CCqO3e0i9+YaV/j9F2pkD6nQl1uYkE94Qisoclqg4tWkUpyRGO
1ziUxsCzjoZC4zyWTDiRWaTCwrSy4IA+avyn9HqjHNav44PPx3KT5B0AHDH6OMK4
EZJ9EQbiirm8yx0l2Qom9PLdxQQHjAwqO3Y468AVwtnIknLXY12nzUa7f+ZzA6eT
WQ2bfwr1UiflQRxYeNZm
=wde5
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Valve Custom args

2013-04-01 Thread André Warnier

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Karthik,

On 4/1/13 8:28 AM, N.s.Karthik wrote:

Reason : I have created a Customized valve as a separate jar  used
for AAA interception of my APPS , Since I cannot configure each and
every application hosted on the Tomcat with filters  and hence
created a Valve to apply this at Tomcat level

I use the IWA (Integrated Window Authentication)  of IE / FFOx for
Active directory AAA Authentication.

On-sucessfull  AAA, in the valve  I need the variables such as 
username/domain name  to be further  used with in each

application

Hence I need to know if any possibilities to fetch the variables
into each of the applications from the valves ...???


Your valve can put anything you like into:

1. The request
2. The user's session
3. The application (context) scope

I recommend #1 or #2, depending upon your needs.

Is my understanding deficient, or is #3 not true ? The Valve doesn't know which 
application has (or will be) been selected, or does it ?


In the context of a Valve doing AAA - and the fact that the OP wants to get the 
authenticated user-id at the app level, I think Michael-O's answer is better, no ?


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat Valve Custom args

2013-04-01 Thread Konstantin Kolinko
2013/4/1 André Warnier a...@ice-sa.com:
 Christopher Schultz wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Karthik,

 On 4/1/13 8:28 AM, N.s.Karthik wrote:

 Reason : I have created a Customized valve as a separate jar  used
 for AAA interception of my APPS , Since I cannot configure each and
 every application hosted on the Tomcat with filters  and hence
 created a Valve to apply this at Tomcat level

 I use the IWA (Integrated Window Authentication)  of IE / FFOx for
 Active directory AAA Authentication.

 On-sucessfull  AAA, in the valve  I need the variables such as
 username/domain name  to be further  used with in each
 application

 Hence I need to know if any possibilities to fetch the variables
 into each of the applications from the valves ...???


 Your valve can put anything you like into:

 1. The request
 2. The user's session
 3. The application (context) scope

 I recommend #1 or #2, depending upon your needs.

 Is my understanding deficient, or is #3 not true ? The Valve doesn't know
 which application has (or will be) been selected, or does it ?

1. As far as request has passed through Mapper, it knows to what
application (Context) and even to what servlet (Wrapper) it goes to.
This happens rather early - in CoyoteAdapter. It happens before the
request is passed to Pipeline (chain of valves).

org.apache.catalina.connector.Request#getContext()

2. If valve was declared in context.xml, it knows what its parent is.


 In the context of a Valve doing AAA - and the fact that the OP wants to get
 the authenticated user-id at the app level, I think Michael-O's answer is
 better, no ?


Best regards,
Konstantin Kolinko

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org