Client-cert sample webapp doesn't work?

In trying to understand how one can use client certificates with a Java webapp in the WS7, I figured I would start with the sample that comes with WS7 (in samples/java/webapps/security/client-cert). Unfortunately, the sample doesn't seem to work. I can install it just fine, and it runs, but it doesn't do what it is supposed to do. When I access the servlet from my browser, I see the message "Welcome to our Certificate secure zone." Unfortunately, it let me access this page without ever prompting me for a certificate, so it's not actually a certificate secure zone. I double-checked in the access logs to see, and sure enough index.jsp is being delivered to an unauthenticated user.
When I examine the web.xml deployment descriptor, it's not clear to me that it should work. Here's the web.xml:
<web-app>
  <display-name>Welcome to Certificate Security Zone</display-name>
  <servlet>
    <servlet-name>clientcert</servlet-name>
    <display-name>clientcert</display-name>
    <jsp-file>/index.jsp</jsp-file>
  </servlet>
  <session-config>
    <session-timeout>30</session-timeout>
  </session-config>
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>clientcert security test</web-resource-name>
      <url-pattern>/*</url-pattern>
    </web-resource-collection>
  </security-constraint>
  <login-config>
    <auth-method>CLIENT-CERT</auth-method>
    <realm-name>certificate</realm-name>
  </login-config>
</web-app>This web.xml seems to imply that the mere presence of a login-config will secure the entire app. The servlet specification seems a bit vague on this point, but since there isn't any auth-constraint in the security-constraint, I don't think the login-config ever applies. I think the login-config only comes into play when a security-constraint requires authentication.
What am I missing in my understanding of the web.xml?
What might prevent this simple sample from working properly? Could there be some other ACL or web server setting that overrides?
Thanks,
Tom

If URI is not a protected resource and you want client authentication, you should use server.xml <ssl><client-auth>...</client-auth></ssl> instead of PathCheck line as I told. Value can be set to "required" or "optional".
However, if URL is a protected resource you DO NOT HAVE to add PathCheck or client-auth element in server.xml.*
After installing client-cert sample application using ant and ant deploy, here is what you have to do to make it work :
1) Add in http-listener element in instance's server.xml :
   <ssl><enabled>true</enabled></ssl>2) Make sure you have a certificate named "Server-Cert" in NSS db in <ws-install-dir>/https-<instance-name>/config or change the certificate name appropriately in server.xml.
3) To make it a protected resource, web.xml should have :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
<web-app>
  <display-name>clientcert</display-name>
<servlet>
    <servlet-name>clientcert</servlet-name>
    <display-name>clientcert</display-name>
    <jsp-file>/index.jsp</jsp-file>
  </servlet>
  <session-config>
    <session-timeout>30</session-timeout>
  </session-config>
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Protected Area</web-resource-name>
      <url-pattern>/*</url-pattern>
      <http-method>DELETE</http-method>
      <http-method>POST</http-method>
      <http-method>GET</http-method>
      <http-method>PUT</http-method>
    </web-resource-collection>
    <auth-constraint>
      <role-name>*</role-name>
    </auth-constraint>
  </security-constraint>
  <security-constraint>
    <web-resource-collection>
      <web-resource-name>Protected Area</web-resource-name>
      <url-pattern>/roleprotected/*</url-pattern>
      <http-method>DELETE</http-method>
      <http-method>POST</http-method>
      <http-method>GET</http-method>
      <http-method>PUT</http-method>
    </web-resource-collection>
    <auth-constraint>
      <role-name>TestRoleOne</role-name>
    </auth-constraint>
  </security-constraint>
  <login-config>
    <auth-method>CLIENT-CERT</auth-method>
  </login-config>
  <security-role>
    <role-name>TestRoleOne</role-name>
  </security-role>
</web-app>4) And sun-web.xml should have :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sun-web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Sun ONE Application Server 7.0 Servlet 2.3//EN" "http://www.sun.com/software/sunone/appserver/dtds/sun-web-app_2_3-0.dtd">
<sun-web-app>
<security-role-mapping>
   <role-name>TestRoleOne</role-name>
   <principal-name>[email protected], CN=Franzl Alpha, UID=alpha, OU=People, O=TestCentral, C=US</principal-name>
</security-role-mapping>
</sun-web-app>You will be able to access http://<host-name>:<port>/ without sending client certificate from the browser.
Now create client certificate and import this certificate in your browser.
Access from the browser, http://<host-name>:<port>/webapps-certificatebased-security/index.jsp browser should prompt for cert selection (if so configured) and the application should get certificate.
P/S I have tested it It works for me this way (without adding <ssl><client-auth> or PathCheck directive).

Similar Messages

  • Upgraded to os7 and done my updates on the apps as they appear.. Any function to do with the iBook store is not working or visible.  The purchase at the end of a sample book doesn't work either.

    Upgraded to os7 and done my updates on the apps as they appear.. Any function to do with the iBook store is not working or visible.  The purchase at the end of a sample book doesn't work either. Anyone have a solution?

    Upgraded to os7 and done my updates on the apps as they appear.. Any function to do with the iBook store is not working or visible.  The purchase at the end of a sample book doesn't work either. Anyone have a solution?

  • FormattedText sample code doesn't work.

    Hi -
    In the supplied sample files with flash 8 (Samples &
    Tutorials/Samples/Actionscript/Loadtext) there's a sample called
    "formattedText.fla". It's exactly what I need... but it doesn't
    work more than once. After one test of the file, without changing
    anything, when I test again I get the unformatted text.
    To get it to work again - *get this* - I have to close the
    file and then open it and try again. It looks great...once.
    I would really love this to work. I've attached the "factory"
    code. Please try it more than once.
    TIA some expert input on this.
    JL

    Thank you, I have just run out all this patches, it's a so hard work, and it took me three days to run them.
    Now I'll turn to test the effect of the patches to the ODM schema, if there is still any question, I'll turn to you for help, thanks in advance!

  • Naming folder 'ROOT' under webapps doesn't work?

    Hi, I am trying to setup a local testing environment so that I could test without going to the server. I copied everything from the server to my local directory. The folder name under webapps is called ROOT on the server.
    But localhost doesn't recognize it when I run tomcat server. Then I changed the name to something else, like 'app', 'test' and even 'root', they all worked, i.e., I can see the index.jsp, and the error message when I try to login(error due to using 'ROOT' as System variable).
    I don't want to change the ROOT variable in all my xml files. Does anyone know why I cannot user ROOT as the root_folder name for my app? Anyway to overcome it? I am running Windows2000 locally.
    Thanks!

    probably some kind of protection with Tomcat, I would try to just change the names to something that works and that isn't reserved.

  • PL/SQL SSO SDK Sample Application doesn't work!

    In the latest document on the SSO SDK (http://download-east.oracle.com/docs/cd/A97329_01/manage.902/a96114.pdf), there is a major programming error in the sample application on page 4-5. There is an invalid EXCEPTION block followed by an invalid ELSE block.
    There is absolutely no help from Oracle Support or Metalink on this issue. I am calling upon all Portal Developers frustrated with this very obvious syntax error to pressure Oracle to rewrite this document ASAP. From what I have read, this seems to be a problem since mid-2000. Let's flood Oracle Support with e-mail demanding this issue to be resolved at the highest priority!
    I can't believe Oracle would allow this document to be released without being thoroughly proofread!

    Bill, thanks for bringing this to our attention. We certainly do our best to avoid documentation inaccuracies. Given the scope of the documentation, unfortuately occationally things slip through and we certainly appreciate it when people take the time to let us know if they find a "doc Bug".
    Hopefully this won't happen too often but just in case (refering to the documentation)
    If you find any errors or have any other suggestions for improvement, please indicate the title and
    part number of the documentation and the chapter, section, and page number (if available). You can
    send comments to us in the following ways:
    Electronic mail: [email protected]
    FAX: 650-506-7375 Attn: Oracle9i Application Server Documentation Manager
    Post:
    Oracle Corporation
    Oracle9i Application Server Documentation
    500 Oracle Parkway, M/S 1op6
    Redwood Shores, CA 94065
    USA
    Thanks again

  • Java 7 update 25 client launched from webstart doesn't work

    Since Java 7 update 25, we have an important issue in our client JavaFX application, launched from webstart (applet, we use the ant fx2 deploy tool)
    Its seems that it is related to the issue https://forums.oracle.com/thread/2552941, due to new classloader scheme with u25 (com.sun.jnlp.JNLPLoader and sun.misc.Launcher.AppClassLoader).
    Our problem occurs when we try to use ImageIO :
    java.lang.ExceptionInInitializerError
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.NullPointerException
    at javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)
    at javax.imageio.ImageIO.<clinit>(Unknown Source)
    ... 3 more
    Exception in thread "Thread-126"
    Date : Mon Jun 24 18:56:37 CEST 2013
    java.lang.NoClassDefFoundError: Could not initialize class javax.imageio.ImageIO
    We checked the getDefaultInstance function in IIORegistry of the jre, it's registering some javax services by using the default Thread classloader.
    We have the feeling that IIORegistry found the wrong classLoader.
    We tried to add the quickAndDirtyFixForProblemWithWebStartInJava7u25 from  theskad81 but didn't help in our fx environment.
    Many thanks if you have some advices for us to find a workaround !

    The problem comes from the fact that sun.awt.AppContext is null with jre7u25 applet !
    I posted a message in Java forum :
    sun.awt.AppContext is null with jre7u25 applet

  • AnyConnect Client profile: group-url in server-list with OGS doesn't work propertly

    Cisco Adaptive Security Appliance Software Version 8.4(4)1
    Device Manager Version 7.0(2)
    Hardware:   ASA5510, 1024 MB RAM, CPU Pentium 4 Celeron 1600 MHz
    #show webvpn anyconnect
    1.disk0:/anyconnect-win-3.1.00495-k9.pkg 1 dyn-regex=/Windows NT/
       CISCO STC win2k+
       3,1,00495
       Hostscan Version 3.1.00495
    Profile in atthach-file. After this profile is uploaded to client Optimal Gateway Selection doesn't work propertly:
    When 'vpn1.mydomain.com/mygroup' (it best TTL server) is unreachable, then OGS try to be connected to other servers, but without group-url, for example 'vpn2.mydomain.com' (instead of 'vpn2.mydomain.com/mygroup')

    Anton,
    It MIGHT be cosmetic:
    http://tools.cisco.com/Support/BugToolKit/search/getBugDetails.do?method=fetchBugDetails&bugId=CSCtz92140
    If not please open up a TAC case and provide DART for such a connection.
    M.

  • PEAP-GTC on Win 7 and 8 platforms (LDAP authentication doesn't work)

    Hi all!
    Customer is using Open LDAP as directory services.
    We're setting Cisco Wi-Fi network with following authentication scheme:
    Wireless LAN Controller - Cisco ACS 5.3 - Open LDAP
    According to the documents ACS - LDAP supports only EAP-TLS and PEAP-GTC methods.
    We need to perform username/password authentication. It works good on Apple and Android devices. But id doesn't want to authenticate Windows 7 clients.
    We're unchecking "Validate Servers certificate" in WLAN settings of Win 7 client, but it still doesn't work.
    It seems, that Windows doesn't support PEAP-GTC method. Are there any workaround to solve the issue?
    I might assume, that there could be some software plug-ins (supplicants) that can be installed on Windows and give support of PEAP-GTC. But in this case customer will face serious organizational issues of provisioning new devices.
    Please advice!
    Thank you!
    Yuriy

    In order to see PEAP EAP-GTC option on the client, you need to install EAP-GTC supplicant on the client machine.
    Check this:
    http://www.cisco.com/en/US/docs/wireless/technology/peap/technical/reference/PEAP_D.html#wp1007967
    Jatin Katyal
    - Do rate helpful posts -

  • RC Components Hosted Demo doesn't work

    Hi,
    Question to Oracle people - why ADF Faces Rich Client Components Hosted Demo doesn't work ?
    Kuba

    Hello KUBA,
    It also happened in the Past
    Its still not up, if you need to use adf demo locally on your machine, please follow this thread
    you can find it here. JDev ADF Demo Site Not Working
    Thank you

  • Client-cert auth impl in web.xml does not work in Oracle Application Server

    Hi,
    I am new to implementing security features on the web applications.. I have developed a new web service using jdev1012 and deployed in OAS 10.1.2. Its working fine according to the business requirements, but I am in need of implementing client-cert authentication to enable the web service available to only those who have client certificate.
    My server details are:
    Oracle Application Server 10g Release 2 (10.1.2)
    Server certificate is in place and SSL mode have been already enabled.. able to access my web service through https://<mydomain.com>/myws/TreqWS as well able to see the WSDL file through https://<mydomain.com>/myws/TreqWS?WSDL.
    I tried to include the following in my web.xml file as part of implementing CLIENT-CERT authentication.
    <security-constraint>
    <display-name>SecurityConstraint</display-name>
    <web-resource-collection>
    <web-resource-name>WSCollection</web-resource-name>
    <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <user-data-constraint>
    <transport-guarantee>CONFIDENTIAL</transport-guarantee>
    </user-data-constraint>
    </security-constraint>
    <login-config>
    <auth-method>CLIENT-CERT</auth-method>
    <realm-name>WSCollection</realm-name> <!-- am not sure about this realm-name and its purpose -->
    </login-config>
    It is not woking as expected, though I have restarted my oc4j container after including this content to the web.xml file. i.e, I am able to invoke the web service though my sample java client program, though I donot have client certificate/keystore.
    I believe I am missing something..Can anyone help me in this regard to implement CLIENT-CERT authentication successfully?
    Thanks,
    Ms

    I am having the same problem with doc and xsl. I have added this
    <mime-mapping>
    <extension>xls</extension>
    <mime-type>application/vnd.ms-excel</mime-type>
    </mime-mapping>
    <mime-mapping>
    <extension>doc</extension>
    <mime-type>application/msword</mime-type>
    </mime-mapping>
    to my web.xml. I even restarted the server. I still see doc and xsl in binary.
    Is there some other setting that needs to take place?
    I am using WL6.1 with fixpack 1.
    I can see the doc and excel files in the browser if I don't go through the weblogic
    server. That just confirms it's not my browser.
    Kumar Allamraju <[email protected]> wrote:
    <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
    <html>
    It works fine for me in 6.1 SP1.
    <br><br>
    If the following doesn't work , can you
    <br>try application/winword instead of application/msword?
    <p>--
    <br>Kumar
    <p>Siming Mu wrote:
    <blockquote TYPE=CITE>Hi,
    <p>I setup in my web.xml a mime mapping as follows,
    <p><mime-mapping>
    <br><extension>doc</extension><mime-type>application/msword</mime-type>
    <br></mime-mapping>
    <p>When I specify a test.doc url, the doc file appears in my browser
    as
    binary data
    <br>instead of download.
    <p>Please reference change request 055002, which decribes this problem. 
    According
    <br>to edocs, it has been fixed in wls6.1sp1.
    <p>But I am seeing it fixed.  Am I doing anything wrong? Thanks.
    <p>Siming</blockquote>
    </html>

  • Mac Mail client doesn't work through DSL

    We just started using a Verizon DSL connection for our small business.  Most things work great -- surfing the web is fast and I can access secure site via browser.  For some reason I cannot connect through DSL to get email when I'm using the Mac Mail version 4.4 client.  The connection just hangs.  I have one pop account and 3 google gmail accounts that I consolidate within the offline client.  I luckily have an alternative wifi connection in this building that I can use to get mail, but I need to switch back to our own nework to use the printer and surf at a higher speed. 
    Our CTO was able to fix it for a day by setting an exception on port 995 -- which is what the mail client uses to retrieve mail. 
    I know it's realted to Verizon DSL because the same computer works at home via our Verizon Fios service.  It's also not an issue with Wifi -- it still doesn't connect when I use a LAN connection directly to the modem.
    Please let me know if there are any fixes or work-arounds. 
    Thanks.
    Rusty

    sample settings
    Incoming 
    Your incoming mail server
    no ssl
    Your email address
    your username
    your password
    outgoing
    outgoing.verizon.net
    no ssl
    my server requires authentication = yes
    your verizon username  (should be the same thing that you use to sign in at http://webmail.verizon.com, test your password by logging in at that website, if it doesn't work, then reset your password and use the correct information)
    your verizon password
    should work on 25 since this part is verizon, but if it doesn't work for whatever reason try 587 
    sometimes third party mail servers don't play nice, and don't use 587 for their alternate port.   like go daddy often uses port 80 for ougoing as an example, your mail server may like 995.  I wouldn't worry about your outgoing settings, and instead use the sample configuration above and let us know if it works.  PREFERABLY you should delete your account settings and start from scratch.   

  • Oracle client 9i doesn't work for windows ordinary user

    Hello All,
    I've installed oracle 9i client on windows xp. Client software works for user belonging to windows administrators group. it doesn't works for ordinary users not belonging to administrators group. Particularly when i run sqlplus from command line i get following error :
    Incorrect environment variable PLUS_DFLT
    Program execution error.
    i also need access to Oracle ODBC driver.
    When i try to configure ODBC source (created by user with administrator privileges) by common user i get following errors :
    The setup routines for Oracle for Oracle in OraHome9i ODBC driver couldn't be loaded due to system error code 5
    Could not load the setup or translator library
    Very appreciate for any help.
    Regards Arkadiusz Masny

    It sounds like the users on the machine do not have access to the Oracle home directory. Check the permissions of the folder by right properties, select the user and check that they have read and then select advanced. Tick the "replace permission entries....." box and apply. This will re apply all user rights in all folders and subfolders. Try again.
    HTH Mark F

  • ITS 6.20 connect to another client doesn't work

    We have an ITS 6.20 .
    Glabal service belong the caracteristics of connection to SAP server (login, pasword, client, systemnamme, systemnumber).
    I want to connect to another client but all the others parameter stay the same as in global service definition.
    The idea I have is to put the client in the URL as parameter but it doesn't work
    example of the URL:
    http://[server]/scripts/wgate/ZAXB18W/!?client=300&record=1&templatelanguage=EN&username=zzz&cdealer=80023456&sessionid=493460714&~check=7ED3B4B75260C2ABA6EA4EF77706770F
    The connection doesn't hold in count the client parameter. It is connected with the client of global parameter.
    Is there anybody who can help me ?.

    Hello Eric,
    You'll need to remove the ~client value in the global.srvc file (and service file of the service being called).  Than the ~client parameter in the URL should work.
    Edgar

  • It doesn�t work lazy loading with remote client (toplink)

    I am trying to use lazy loading in a @ManyToOne field but I get an exception. I have been reading in some oracle tutorials that it's necesary use -javaagent:.../lib/toplink-essentials-agent.jar for that it works because this argument activate dynamic weaving in JavaSE. I have put this command line argument javaagent but it doesn't work. Why? Can I have to do another thing? I have done a lot of tests in base to comments read in another forums but I only obtains an exception.
    Caused by: java.io.IOException: Mismatched serialization UIDs
    NOTE: The server use toplink and the remote client query the entitties through a session bean of the server. Besides, I am using Glassfish (Sun application server and toplink).
    Thanks in advance.
    hayken

    At first, thank you for your reply.
    I know that I haven´t explained the problem too well. I have a stateless bean with one remote method that execute a query an returns an entity like this
    @Entity
    public class ModuloEntity extends Serializable
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long idModulo;
    private String nombre;
    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="IdProyecto")
    private ProyectoEntity proyecto;
    The remote client invoke this method and in that moment I get this exception.
    21-may-2007 18:55:48 com.sun.corba.ee.impl.encoding.CDRInputStream_1_0 read_value
    ADVERTENCIA: "IOP00810211: (MARSHAL) Exception from readValue on ValueHandler in CDRInputStream"
    org.omg.CORBA.MARSHAL: vmcid: SUN minor code: 211 completed: Maybe
    at com.sun.corba.ee.impl.logging.ORBUtilSystemException.valuehandlerReadException(ORBUtilSystemException.java:7053)
    Caused by: java.io.IOException: Mismatched serialization UIDs : Source (Rep. IDRMI:com.syskonic.gesplan.entities.ModuloEntity:6D06A8C14D488FFF:8E6FC8687EA9E512) = 8E6FC8687EA9E512 whereas Target (Rep. ID RMI:com.syskonic.gesplan.entities.ModuloEntity:1C6925798CDFD3DF:3455DBF4457AE337) = 3455DBF4457AE337
    at com.sun.corba.ee.impl.util.RepositoryId.useFullValueDescription(RepositoryId.java:573)
    If I look the server log, I can see that the call has not been produced, it doesn´t show any exception. It looks that the object managed by the server and the remote client aren´t the same and the corba service doesn´t work when remote client call session method. If I change the ModuloEntity and remove the fetch attribute then all this process executes correctly. The problem is in this attribute.
    NOTE: I am using the javaagent command line argument.
    Hayken

  • Property default value in presentation doesn't work in vSphere Web Client.

    Hi,
    Some of my default values don't work in the vSphere Web client.
    Here is an example :
    The user need to choose a date, this input parametter is called "FormDateRealisation".
    In the next step, I have a user interraction with external input called "AppDateRealisation", that is an attribute. In the presentation, this parameter as a Default value property set to "#FormDateRealisation".
    It work perfectly in the Java client, but when I try the workflow in vSphere web client, the default value doesn't not work.
    Does anyone have an idea how to solve this ? I already found a solution to bypass this bug (Creating a script to transfert the input to the attribute)... But I would like to use the default value.

    Hi,
    I opened a ticket, they didn,t found the solution. But we found those logs:
    Execution of action com.DemandeServeur/EspaceDisqueMultiple10 returned a javacsript 'undefined' value. Perhaps a return statement is missing in this action ? Will be converted to null.
    Here is my code of "EspaceDisqueMultiple10":
    Return type: string
    Input: InGBHD (number)
    if (InGBHD%10 != 0)
      return "L'espace disque doit être un multiple de 10";
    else
      return;

Maybe you are looking for

  • HashSet get() and contains() methods, by value or reference?

    All the tutorials I've seen on HashSets use Strings as the object type. With Strings, it seems the get() and contains() methods work by value, not by reference. <CODE> String s1 = "dog"; String s2 = "cat"; String s3 = "dog"; HashSet<String> set = new

  • VBA code not working in SEM-BPS 3.2

    We are currently running on BW 3.1 and SEM-BPS 3.2 environment. I am trying to create a screen in excel with VBA code doing validation on user input. For some reason the code works perfectly fine in standalone Excel. But when it comes to BPS, the cod

  • Note field in the FI Enjoy transactions

    Hello! when an FI enjoy transaction is used, there is a possibility to enter a Note on the tab Notes. Can you please help me to find where the content of the note is kept? As far as I know it is not recorded in a table but in a file. Thanks a lot!

  • Quick time 'this is not a movie file' error message

    PLEASE HELP! i've recently downloaded some movies off the internet (.avi files) and although all have originally opened and played in quicktime, i am now getting 'this is not a movie file' error messages for all of them. I've had this before and rest

  • Move Focus from Web Adress Bar when Google search page loads

    '''This relates to Firefox 4''' I use google search as my home page - when i start firfox or open a new tab manualy i want to have the focus start in the google search box, but in stead it stays in the search bar - is there a way to correct this beha