aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes FORM atuthentication question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "FORM atuthentication question" Watch "FORM atuthentication question" New topic
Author

FORM atuthentication question

Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1097
    
    1

Hi

I have a question related to form authentication.
<realm-name> element is not allowed within <login-config> element when <auth-method> is FORM.
But when i ran an example having login config element , there was no error on front end and authentication went fine.
Also in Tomcat logs, i did not got any error





This is confusing as let us say if we get an question in exam whether adding <realm-name> for FORM authentication will produce an error or not then what should i answer. Compilation error ? or No compilation error ?


Oracle Java Web Service Developer (1z0-897), Oracle certified Java 7 Programmer, SCJA 1.0, SCJP 5.0, SCWCD 5.0, Oracle SQL Fundamentals I
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9302
    
  17

<realm-name> element is not allowed within <login-config> element when <auth-method> is FORM.

Who said this?? Moreover, your configuration that you've shown doesn't actually use <realm-name> tag...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41800
    
  62
The ultimate reference on what must -and what need not- be part of the web.xml file is the Servlet specification. If you search it for " name="realm-name " you will find that its schema entry specifies " minOccurs="0" " - meaning it is optional.


Ping & DNS - my free Android networking tools app
Abhay Agarwal
Ranch Hand

Joined: Feb 29, 2008
Posts: 1097
    
    1

Sorry i forgot to add <realm-name> tag.
I know <realm-name> tag is optional but i think we can not add <realm-name> tag when using FORM atuthentication.
So my question is what will be the behaviour of Container when i add <realm-name> tag for FORM authentication ?
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9302
    
  17

Abhay Agarwal wrote: i think we can not add <realm-name> tag when using FORM atuthentication.

Again, where did you find it that realm-name cannot be used with FORM authentication??
Chinmaya Chowdary
Ranch Hand

Joined: Apr 21, 2008
Posts: 432
Hi, Abhay.
I know <realm-name> tag is optional but i think we can not add <realm-name> tag when using FORM atuthentication.

We can add <realm-name> tag when using FORM based authentication. See 'Deployment Descriptor
Version 2.2' of Servlet 2.4 specification.
So my question is what will be the behaviour of Container when i add <realm-name> tag for FORM authentication ?

Authorization will be done on the specified web resource name. See this example.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: FORM atuthentication question