JAAS LoginModule - how do I get the "JSessionId"

Hi,
is there any possibility to get the JSessionId from a custom JAAS LoginModule for the WebAS 6.40 Server.
My first attempt was to read the JSESSIONID-Cookie from the Http-Request via the HttpGetterCallback-Class.
((HttpGetterCallback) callbacks[1]).setType(HttpCallback.COOKIE);
((HttpGetterCallback) callbacks[1]).setName("JSESSIONID");
It worked well, till I noticed that sometimes the JSessionId-Cookie doesn't exist.
The reason is, that the JSession-Cookie was set after the http-request has passed my login-modul.
So, if I got a cookie-value, it sometimes was the JSessionID from an earlier session.
So, my question:
Is there any other posibility to get the JSessionId?
If there is a way to get the ServletRequest-instance,  I could reach the SessionId via "HttpServletRequest.getSession()".
Any idea? Any hints?
Regards
Steffen Spahr

This is only available for NetWeaver Portal, not NetWeaver Application Server(WebAS). host and port can be obtained using the following code:
               Callback[] callbacks = new Callback[3];
               callbacks[0] = new NameCallback("UserId: ");
               callbacks[1] = new PasswordCallback("Password: ", false);
               // get host name and port
               HttpGetterCallback getterCallback = new HttpGetterCallback();
               getterCallback.setType(HttpCallback.HEADER);
               getterCallback.setName("Host");
               callbacks[2] = getterCallback;
               try {
                    callbackHandler.handle(callbacks);
               } catch (Exception ex) {
                    throw new LoginException(ex + "");
               Object retValue = ((HttpGetterCallback)callbacks[2]).getValue(); //get host
host and port will be returned in the following format SERVER.COMPANY.COM:50000
Currently WebAS is not able to return the resource as per SAP development.

Similar Messages

  • JAAS LoginModule - how do I get path, port, resource accessed, etc

    Hi,
    I checked everywhere including the forums, but could not get any info on this. I'm writing a custom JAAS LoginModule for the WebAS 6.40 server. I'm trying to figure out how to get the following out of the request from within login() or initialize() or any other method:
    1. Name of the webserver (i.e. the WebAS server being accessed like www.mycompany.com)
    2. Resource (e.g. /QuickCarRental)
    3. Port through which the request comes in (e.g. 50000)
    The URL being accessed in the above case is http://www.mycompany.com:50000/QuickCarRental
    Appreciate your help, and points will be awarded. Have a nice day
    R Abraham

    This is only available for NetWeaver Portal, not NetWeaver Application Server(WebAS). host and port can be obtained using the following code:
                   Callback[] callbacks = new Callback[3];
                   callbacks[0] = new NameCallback("UserId: ");
                   callbacks[1] = new PasswordCallback("Password: ", false);
                   // get host name and port
                   HttpGetterCallback getterCallback = new HttpGetterCallback();
                   getterCallback.setType(HttpCallback.HEADER);
                   getterCallback.setName("Host");
                   callbacks[2] = getterCallback;
                   try {
                        callbackHandler.handle(callbacks);
                   } catch (Exception ex) {
                        throw new LoginException(ex + "");
                   Object retValue = ((HttpGetterCallback)callbacks[2]).getValue(); //get host
    host and port will be returned in the following format SERVER.COMPANY.COM:50000
    Currently WebAS is not able to return the resource as per SAP development.

  • How do I get the Principals as well as the Permissions from Policy?

    I know how to get the permissions from a Policy:
      MyPolicy.getPermissions()
    How do i get the Principals and Permissions?
    If I have:
    grant MyPrincipalClass "Jeff" {
       permission MyPerm "doIt"
    how do I then (in my code) get both the permission and the Principal?
    I am currently doing this:
    java.security.PermissionCollection pc = pol.getPermissions(new java.security.CodeSource(new java.net.URL("file:/D:/JAAS/"), null));
    for (java.util.Enumeration en = pc.elements(); en.hasMoreElements(); )
                    System.out.println(en.nextElement());
    }

    In reference to your earlier question about "setting the Principal"; those responders pointed you to the JAAS documentation, and that's the answer here, too. You need to implement a Policy class that uses the JAAS Subject as a parameter to the Policy constructor as well as to the getPermissions() method. The Subject contains the Principals that have been added to it by (your) involved LoginModules. I'm still using JAAS 1.0 on JDK 1.3, and am real not familiar yet with the JDK 1.4 version of Security, but; I think the same applies there. Keep in mind; the "grant" only declares the permissions for a Principal; it's up to the LoginModules to establish the identity (identities) of the authenticated Principal(s) to which those permissions are to be granted.

  • I am having macbook air recently my iphotos did not open and was showing report apple and reopen but i came to know that by pressing alt and iphotos i open an new photo library and stored the pics but now how can i get the pics which i had in the earlier

    i am having macbook air recently my iphotos did not open and was showing report apple and reopen but i came to know that by pressing alt and iphotos i open an new photo library and stored the pics but now how can i get the pics which i had in the earlier photo please help me to recover my photos

    Well I'll guess you're using iPhoto 11:
    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In early versions of Library Manager it's the File -> Rebuild command. In later versions it's under the Library menu.)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one.  
    Regards
    TD

  • How can i get the all values from the Property file to Hashtable?

    how can i get the all values from the Property file to Hashtable?
    ok,consider my property file name is pro.PROPERTIES
    and it contain
    8326=sun developer
    4306=sun java developer
    3943=java developer
    how can i get the all keys & values from the pro.PROPERTIES to hashtable
    plz help guys..............

    The Properties class is already a subclass of Hashtable. So if you have a Properties object, you already have a Hashtable. So all you need to do is the first part of that:Properties props = new Properties();
    InputStream is = new FileInputStream("tivoli.properties");
    props.load(is);

  • I accidentally erased a music album that I purchased on iTunes. How can I get the iTunes store to recognize that it is no longer in my iTunes library and download it again?

    I accidentally erased a music album that I purchased on iTunes. How can I get the iTunes store to recognize that it is no longer in my iTunes library and download it again?

    Delete the broken links in iTunes then look at your purchased list to redownload.
    If this happened because you were deleting files from the iTunes folder in Finder, don't.  You have to let iTunes do all the deleting and moving or you will end up with broken links.

  • How can I get the iCloud/iTunes password for my (now) deceased Father-in-Law's Imac?  I have a list of his passwords, but nothing works!

    How can I get the iCloud/iTunes password for my (now) deceased Father-in-Law's iMac?  I have a list of his passwords, but nothing works!  I know his email, but that account has been cancelled for security purposes, so we can't just request a new one.  I tried his security questions to no avail.
    Thanks

    Since that password is tied to his Apple ID, you will need to contact Apple; as far as I know, it will be a somewhat lengthy procedure and you will  need to furnish necessary paperwork (including a death certificate as far as I know). Best to either stop at an Apple store or call them to find out exactly what it is you need to do.

  • I deleted a calendar tab. How can I get the data back?

    I accidently deleted the calendar tab of my wife and deleted all her apoointments on her iphone and the iMac. I am in ****. How can I get the calendar data back=?

    Sync is only oneway, from PC to your device. Unless you have the music on your PC, iTunes is going to wipe out what you have on your device if you are syncing to a new library.
    You can only transfer Purchased music over to Itunes on your PC.
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    http://support.apple.com/kb/HT1848
    As for you own music, you may have to use a third party software. A good Free one is called Sharepod which you can download from Download.com here:
    http://download.cnet.com/SharePod/3000-2141_4-10794489.html?tag=mncol;2

  • Can't install the software for the Brother MFC-9440CN because it is not currently available from the Software Update server....how do I get the driver then..it ised to work in my old mac..but cant print to it in my new unit

    Can't install the software for the Brother MFC-9440CN because it is not currently available from the Software Update server....how do I get the driver then..it ised to work in my old mac..but cant print to it in my new unit

    Download the Brother Mountain Lion drivers here.

  • HT2731 If i purchased coins on a game (doubledown casino) and did not get the coins, but was charged for them what do i do? How do i get the coins or my money refunded?

    If i made a purchase on a game(doubledown casino) but never got my coins, but the money was taken out of the account, what do I do? How do I get the coins or my money back?

    Contact iTunes Customer Service and request assistance
    Use this Link  >  Apple  Support  iTunes Store  Contact

  • How do I get the activity window in safari 6.0.2?

    How do I get the activity window in safari 6.0.2?

    Safari 6
    Activity Window is no more available in Safari 6.
    Apple removed that feature.
    Best.

  • How do you get the web application path from the servlet?

    I have created a web application which is installed in
    /webapps/myApplication
    /webapps/myApplication/data/users.xml
    /webapps/myApplication/WEB-INF/classes/myServlet
    How can you get the path to the "users.xml" file from the "myServlet" file?
    The code below doen's seem to return the xml file. anybody knows why?
    public class myServlet extends HttpServlet {
    public void doGet( HttpServletRequest req, HttpServletResponse res ) throws ServletException, IOException
    File myXmlFile = new File("/data/users.xml");

    Try this..
    String FileName = getServletContext().getRealPath("\\data\\users.xml");
    File myXmlFile = new File(FileName);
    hope this helps..

  • I am using FCP 7.0.3.on my Mac Pro. I bought a new mac book pro and loaded the software on to the lap top but the software is 6.0.3. How do i get the update to the lap top?

    I am using FCP 7.0.3 on my Mac Pro. I bought a new mac book pro and loaded the software on to the lap top but the software is 6.0.3. How do i get the update to the lap top?

    .. and by the way, the jump from FCP 6.0.3 to FCP 7.0 (or higher) isn't an "update"  It's a full version "upgrade" that has to be done using the install discs (or disc images).
    -DH

  • HT1386 My MacBook Pro HD crashed.  It is all up and runmning except for one issue.  I have about 200 songs on my iPhone but have only gotton 53 back on my laptop and those are the songs I purchased via iTunes. How do I get the rest of the songs from iPhon

    My MacBook Pro HD crashed.  It is all up and runmning except for one issue.  I have about 200 songs on my iPhone but have only gotton 53 back on my laptop from my iPhone and those are the songs I purchased via iTunes. How do I get the rest of the songs from my  iPhone back onto my HD. 
    The songs I'm not able to import casme from CD's.  Nothing from napster etc.
    I've tried and tried to import them rom iTunes vis "Library"  " Import"

    Hey kbert73
    I would do a transfer of purchases from the phone and not sync. If you sync then it will want to start over and sync music that is on the MacBook Pro. If you want to transfer the music, check out the article below that will give you multiple options on how to move. I have also provided on how to sync with multiple computers.
    iTunes: How to move your music to a new computer
    http://support.apple.com/kb/ht4527
    Using iPhone, iPad, or iPod with multiple computers
    http://support.apple.com/kb/ht1202
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • HT4101 Once pictures are moved from your camera to your iPad (using the camera connection kit), how do you get the photos off of the iPad? They do not show up in my photo stream or my iCloud.

    Once pictures are moved from your camera to your iPad (using the camera connection kit), how do you get the photos off of the iPad? They do not show up in my photo stream or my iCloud. I am able to see any photo I took on the iPad using the iPad camera (in iTunes, photo stream, or when I open windows explorer and browse the iPad director), however I cannot see any photos transfered from my camera to the iPad. The camera connection kit must have put my photos in a directory I cannot get to and cannot sync.

    The links below have instructions for deleting photos.
    iOS and iPod: Syncing photos using iTunes
    http://support.apple.com/kb/HT4236
    iPad Tip: How to Delete Photos from Your iPad in the Photos App
    http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
    Another Way to Quickly Delete Photos from Your iPad (Mac Only)
    http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
    How to Delete Photos from iPad
    http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
    How to: Batch Delete Photos on the iPad
    http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
    (With iOS 5.1, use 2 fingers)
    How to Delete Photos from iCloud’s Photo Stream
    http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
     Cheers, Tom

Maybe you are looking for

  • How to use local .sdf database in a windows store apps

    Hi, I am new in windows store app development. I have been working in WPF application development for long time. Now I want develop windows store apps. I am studying on it. I got a problem. I what to store data from windows store app in .sdf database

  • Archive FCP project to device?

    So, I've been archiving audio, video, and graphics to our Superloader 3a like a mad dog. Everything's been going great -- until I tried to archive a FCP project. When I right-click on that asset, there's no "Archive" option. Shouldn't I be able to ar

  • Digital out is no option in sounds

    Dear you, I have bought a belkin optical cable for my new minimac intel duo. In this new minimac they made an analog and a digital out in one plug. Beautifull design, but how can I convince my Minimac to give an optical signal instead of an analogue

  • I want to sync all my contacts

    i want to sync all my contacts from phone how to do?

  • 8900 Invoke Camera Error

    Im trying another way of getting the camera to work on my 8900 device, and again Im having trouble.... 8900 v4.6.1.231 platform : 4.2.0.108 Im using this code to call Invoke :---------------------------------------------------------------------     I