How to authenticate a JWS Client download of jar files on a web server

Here is a history of how i tried to implement the auth system:
The resources(jar files) cannot be downloaded by any HTTP client from the server without some authentication method.
As JWS is not reliable when using cookies (only 1.5 supports them, but with problems when in JNLP file i specify j2se version=older that 1.5) , i implemented another mecanism that works like this:
1. 1.The template JNLP looks like this
<?xml version="1.0" encoding="utf-8"?>
<jnlp codebase="http://10.3.0.62/" href="mapped/#JWS_CODE#___#PLATFORM#___app2.2.jnlp">
    <information>
       bla bla
    </information>
    <security>
        <all-permissions/>
    </security>
    <resources>
        <j2se version="1.4"/>
        <jar href="http://10.3.0.62/mapped/gui.jar?jwsid=#JWS_CODE#" version="2.2"/>
        <jar href="http://10.3.0.62/mapped/data.jar?jwsid=#JWS_CODE#" version="2.2"/>
        <jar href="http://10.3.0.62/mapped/log4j.jar?jwsid=#JWS_CODE#"/>
    </resources>
    <application-desc main-class="com.bet.blues.gui.Application">
        <argument>-host</argument>
        <argument>ursus</argument>
        <argument>-port</argument>
        <argument>17771</argument>
    </application-desc>
</jnlp>2. All resources found in /mapped/ directory are mapped to JWSServlet
3. The users login to a site , clik on link , /mapped/app2.2.jnlp , the servlet checks if the session is active , gets the PLATFORM form browser request header , gets the JWSCODE for the logged user, replaces this in the template, and returns it to the client
4.Now after the 1st download the JNLP file is opened by JWS Client , that checks for latest version , requesting the JNLP file again
like this:
GET http://10.3.0.62/mapped/f12ks21092___windows___app2.2.jnlp5.Now the servlet sees the the request has a JNLP file name with an ID and PLATFORM, and serves the JNLP as before
6.The JWS Client will request for JAR Files
GET http://10.3.0.62/mapped/gui.jar?jwscode=f12ks21092?version-id=2.2Note: that i have forced JWSID parameter in the URL, that's why the query string contains 2 "?"
- forcing this is because the mapped/*.jar is redirected JnlpDownloadServlet that supports versions , diffs - i cannot use 'version' to put there the jswid param(e.g .../mapped/gui.jar version="fk12ks21092_2.2" because the JnlpDownloadServlet will not find this version , and if JWS Servlet will redirect to JnlpDownloadServlet with correct version param in request, the JWS Client will raise an exception because version responded is not right(JNLPDownloadServlet marks in response HTTP header the version of the jar so JWS CLient will chek it)
JWS Client expects version 'fk12ks21092_ver2.2'; to correct this i should modify the JnlpDownloadServlet and i shouldnt
THE PROBLEM :
on older versions than 1.5 JWS Client raises an exception because it wants to create a temp file named
" gui.jar?jwscode=f12ks21092" because it contains "?"
Only with 1.5 that seems to parse the jar name until it meets "?" char :(
Thats why i wanted to send an error to the client to upgrade to Java Web Start 1.5
Now, maybe u have a solution to this problem...
All i want is a solution to let JWS Client download jars only if the user is authenticated by some mecanism....and also support the versioning system.
Also:
Note that the jar names must preserve on the client JWS Cache dir ( i cannot use the same method to pass the JWSCODE when requesting the JARS as when requesting the JNLP).

You need to look into JAAS

Similar Messages

  • How can i download these jar files to load SQL server derive

    Hi
    pls tell me how can i download these jar files and from what site i can do that to enable to load SQL server driver
    msbase.jar
    msutil.jar
    mssqlserver.jar

    if u use sqlserver 2000 u can download for free from microsoft.com
    and other sites are freetds.com i guess

  • How to download the .jar files for ESB?

    Hi,
    I'm connecting to a remote sandbox environment of CE 7.2. I'm running into the problem that some links point to URLs without a fully qualified host name. For example, in ESR (url .../rep) the link that points to the Enterprise Service Builder is http://server:port/rep/start/repository.jnlp instead of http://server.company.com:port/rep/start/repository.jnlp
    As a result, clicking the link results in Page not found.
    As a workaround, I can type the URL manually in the address field of my browser.
    That way, I can launch Web Start. However, it does not solve my problem, because soon after, the download fails because some of the .jar files have the short URL.
    I get the error message "Unable to load resource: http://host:port/rep/repository/com.sap.xpi.ibrep.client.jar
    Now how can I download the .jar files so that I can start the ESB? Typing the URL into the browser doesn't seem to work, and I don't know what else I should download to launch ESB.
    Is there a post-installation way to specify the URL for the components?
    Edited by: Arto Pihlaja on Dec 4, 2010 11:37 PM

    Found it.
    I had to change the value of the parameter com.sap.aii.connect.repository.name under CE - Administration - Properties Administration.

  • How to inform the client when the jar files is updated?

    I have a question about jar file updatation by web start, please help me.
    If a client's jar file is updated in Web server and automatically downloaded to local cache, how the client know which jar file is updated?. If I want to do some special operation after updating a appointed jar file, how can I do?

    Contrary to common popular belief, this forum is not a free 'I will look up/abstract the documentation on your behalf' forum.
    You can look up sqlnet.expire_time on http://tahiti.oracle.com or may be even Google will work.
    Please do not abuse this forum by asking doc questions.
    Sybrand Bakker
    Senior Oracle DBA

  • How do I stop adobe updates downloading as Simulink files in Matlab in order to update the program?

    How do I stop adobe updates downloading as Simulink files in Matlab in order to update the program?

    Hi Jess ,
    Please launch Acrobat>Navigate to Edit>Preferences>Updater>Check mark the option"Do not download or install updates automatically" and uncheck rest of the options or you may choose whichever suits your requirement.
    Regards
    Sukrit Dhingra

  • Downloading a jar file

    Hi guys,
    i want to download a jar file from an url: www.xxx.com/file.jar
    now how is the best way todo this?
    Thanks in advance!

    Since I saw the post before you edited it, I'm going to assume that you accidentally provided a URL that linked to a sex site. Therefore I shall just block the post.

  • HT3678 If I download a .mov file from gmail, I am not able to open the file. I reinstalled QuickTime 7.6.6, still unable to open the file. If I download the same file from another mail server I have no trouble. What is gmail doing to my file?

    If I download a .mov file from gmail, I am not able to open the file. I reinstalled QuickTime 7.6.6, still unable to open the file. If I download the same file from another mail server I have no trouble. What is gmail doing to my file?

    Also i have reinstalled the reader9 two  times and tried with reader8 also but in both the cases same problem.
    it would be gr8 help if someone can help.

  • How do you know the version of a JAR file ?

    how do you know the version of a JAR file ?
    is it what is written on MANIFEST.MF ?
    for example i have a JAR file
    whose MANIFEST.MF has this
    Manifest-Version: 1.0
    Created-By: Ant 1.4.1so, whats the version of this JAR ? 1.0 ?

    anyway, that was JSTL..jar.
    Now, come to another JAR file....
    whose MANIFEST.MF has......
    Manifest-Version: 1.0
    Created-By: Apache Ant 1.5.1
    Extension-Name: Struts Framework
    Specification-Title: Struts Framework
    Specification-Vendor: Apache Software Foundation
    Specification-Version: 1.1
    Implementation-Title: Struts Framework
    Implementation-Vendor: Apache Software Foundation
    Implementation-Vendor-Id: org.apache
    Implementation-Version: 1.1
    Class-Path:  commons-beanutils.jar commons-collections.jar commons-dig
    ester.jar commons-logging.jar commons-validator.jar jakarta-oro.jar s
    truts-legacy.jarso, How do you believe whats the version now ? do u go with the comment "Manifest-Version: 1.0" or "Specification-Version: 1.1" ?
    definitely, you would go with the "Specification-Version: 1.1" and declare this JAR as STRUTS 1.1
    hmmm, so, if nothing is mentioned like above should we follow the MANIFEST version as the JSTL version ? in my earlier example i did not find any comment on ""Specification-Version" ......so , if anybody gives me that JAR , how do i decide whether its 1.0 specification or 1.1 specifucation compliant ?
    can you tell whats the JSTL version of my earler example JAR file ?

  • From where can I download the jar files to use JAXB 2.0?

    Hi all,
    From where can I download the jar files to use JAXB 2.0?
    ~Regards

    Does the government not let you do Internet searches where you live? My Internet search for "JAXB 2.0" returned this:
    https://jaxb.dev.java.net/
    as the first link. If you can't find it from that page it doesn't exist.

  • How do I list all classes in a Jar file?

    How do I list all classes in a Jar file?

    Its no problem if the jar file contains classes, but I have an EAR file, which contains a jar-file, and I want to list all classes in that jar-file.
    I would like to do something like this:
    java.util.jar.JarFile jarfile = new java.util.jar.JarFile( new File("/meYear.ear"), true );
    java.util.jar.JarEntry jar = jarfile.getJarEntry( "myJar.jar" );
    // Cast it to a new JarFile:
    java.util.jar.JarFile newJar = (java.util.jar.JarFile)jar;
    But the method getEntry returns something like jarFile$JarEntry, if I try to class cast it I get an classCastException.

  • Problem when downloading the JAR file

    I'm just install JRE and testing my first applet application. I'm facing the problem that I can not download the JAR file from my localhost computer.
    I've enable cache in Java Control Panel and running my applet. Normally, it will download the jar file from my localhost and save it to the cache directory of Java. And then finding all classes neccessary to run my applet in the JAR file.
    But I discover that I can not download the JAR file and save to my computer. I try to put the URL to download this JAR file (http://localhost/myjar.jar) in my web address, it start to download this file properly. But when open it with WINRAR, I got an error that the file "Unexpected end of file".
    I try to put this file from onther computer in my LAN. And use the URL to download it. This time I can open the JAR file with WINRAR althrought the file size is the same
    Anyone know why there are some errors when download from my localhost? Thanks in advance for any help!!!

    Yeah everything matches up!
    Could it have something to do with the string encoding? I created the file in ANSI format? Would this have an effect on it?

  • How to authenticate  new mac to download iTunes songs

    Just picked up my new macbook pro - on itunes, I can see my songs, and play snippets, but I need to authenticate so I can download my song list. How do I do that? thanks.

    http://support.apple.com/kb/PH1706
    this will help u for sure

  • How to forced JWS to download only jar we want

    Hi everybody !
    In my application, which run from an ftp adress with Java Web Start, I load a main jar.
    After, I will have the opportunity to load in the cache any secondary jar I want (those jar are not required by the application at the beginning) : I just want to click an a button to load the jar I want.
    I try to put a download="lazy" in the jnlp file, but JWS still download the secondary jar after the application is loaded : it is possible to forced JWS to not download this secondary jar, in the optic to download it manually after ?
    Thanks in advance !!!

    You need more than download="lazy" in the jnlp..... You also need to specify part="{somthing}" ...for example (Taken from vamphq).
    <jar href="skinlf.jar" download="lazy" part="skinlf"/>Then, in your client code, you need to explicitly instruct webstart to download this part - use the following (Modified from webstat developers guide):
    DownloadService ds;
             try {
                 ds = (DownloadService)ServiceManager.lookup("javax.jnlp.DownloadService");
             } catch (UnavailableServiceException e) {
                 ds = null;
             if (ds != null) {
                 try {
                     // determine if a particular resource is cached
                     boolean cached = ds.isPartCached("skinlf");
                     if (!cached) {
                     // Load the resource into the cache
                     DownloadServiceListener dsl = ds.getDefaultProgressWindow();
                     ds.loadPart("skinlf",dsl);
                 } catch (Exception e) {
                     e.printStackTrace();
             } You cant put any references to any class in the java that you are downloading in this file... Because, it will crash with 'Class not found'. Instead, use reflection to dynamically load your class. Ie, instead of doing:
    new org.me.DownloadedClass();do this instead
    Class.forName("org.me.DownloadedClass").newInstance();Message was edited by:
    tonywestonuk

  • How can I create a client console and work together with the Cache Server?

    How can I edit the following Cache-Server.cmd file to create a client console and work together with the Cache Server?
    The following is the cache server file: contacts-cache-server.cmd
    @echo off
    setlocal
    if (%COHERENCE_HOME%)==() (
    set COHERENCE_HOME=c:\coherence
    set CONFIG=C:\home\oracle\coherence\Contacts
    set COH_OPTS=%COH_OPTS% -server -cp %COHERENCE_HOME%\lib\coherence.jar;C:\home\oracle\
    coherence\Contacts;C:\home\oracle\coherence\Contacts\classes;
    set COH_OPTS=%COH_OPTS% -Dtangosol.coherence.cacheconfig=%CONFIG%\contacts-cache-config.xml
    java %COH_OPTS% -Xms1g -Xmx1g -Xloggc: com.tangosol.net.DefaultCacheServer %2 %3 %4 %5 %6 %7
    :exitEdited by: junez on 23-Oct-2009 09:20

    Hi
    To run the console, change DefaultCacheServer to CacheFactory
    Paul

  • How do I make Firefox automatically download and install files?

    When I download an exe file from the internet, it goes over to the download window. I can see it downloading but I always have to right click and and select open to get it to install. How do I get it to always install automatically? There is never any option called "Download this type of file all the time".

    I've been trying to figure this out for days.

Maybe you are looking for

  • Why can't OSX track multiple copied clipboard items? Windows has been doing this for years. It's pretty much infuriating.

    For the umpteenth time, I've cut some huge chunk of text out of a dialogue box only to lose it following a momentary lapse in concentration. With all the 'it just works' propaganda I've heard and repeated over the years, I'm dumbfounded that Apple en

  • Yahoo toolbar bookmarks missing version 36

    For people missing their bookmarks on the latest version of yahoo toolbar , I actually received a response from Yahoo today. "Hi , We are aware that some users are unable to access their bookmarks in the Yahoo Toolbar. Our engineers are working on a

  • How to uncheck File and Printer Sharing for Microsoft Networks by Command!!

    Dear everybody, I meet a problem with my System now, and I need your help!!! As mentioned in title, I need uncheck on File and Printer Sharing for Microsoft Networks by Command for Security purpose. Could you show me the way to do it by command line

  • Emailing the report to external email -  Background job

    HI We are creating background job for running the report in background...but i want the output(report) to send an email in Excel format after the job run successfully... Here the email is External email not SAP inbox.. Do you have any idea how to ach

  • APO DP CVC

    I was unfortunately deleted CVC's related to one customer could you please let me know how to retrive those combinations, when i checked in the  amnage log there i unable to see the detaled data, except the customer no thanks in advance