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.

Similar Messages

  • 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.

  • How do I get into iTunes to access Netflix, when I get "iTunes unable to connect until time has been set", after submiting my password?

    How do I get into iTunes to access Netflix, when I get "iTunes unable to connect until time has been set", after submiting my password?

    You need to follow the instructions in this article that best apply to your situation:
    Forgot passcode for your iPhone, iPad, or iPod touch, or your device is disabled - Apple Support
    If you do not have a backup in either iCloud or iTunes, then you will have no way to retain the information on your device because you will have to restore it in order to access it again.
    Sorry,
    GB

  • How do i get my laptop to access the itunes library on my external drive hooked up to my desktop via my home network?

    How do i get my laptop to access the itunes library on my external drive hooked up to my desktop via my home network?

    If you are willing to pay $24.99 per year for iTunes Match you can put your library in the cloud provided you don't have more than 25,000 tracks.
    iCloud- iTunes Match
    iTunes in the Cloud and iTunes Match Availability
    iTunes Store- Troubleshooting iTunes Match
    iTunes- How to add a computer or iOS device to iTunes Match

  • EyeConnect says my Samsung 40D8000 'can access this computer' ... but how to I get the TV to access the Mac?

    EyeConnect says my Samsung 40D8000 'can access this computer' ... but how to I get the TV to access the Mac? 
    All I want to do is to have the new TV connect to iPhoto, and if possible, iTunes, on the Mac and although there are plenty of forums discussing problems (such as FF and RW not working) all I want to do is basically CONNECT!
    The Samsung AllShare tool is not seeing the Mac, the Mac is 'seeing' the TV in the EyeConnect setting box (but not in Finder).
    Please help me to get these two guys talking!!!
    Tim

    iTunes: How to move [or copy] your music to a new computer [or another drive] - http://support.apple.com/kb/HT4527
    Quick answer if you let iTunes manage your music:  Copy the entire iTunes folder (and in doing so all its subfolders and files) intact to the other drive.  Start iTunes with the option (shift on Windows) key held down and guide it to the new location of the library.

  • I have bought an iPad 2 recently but when i open itunes, i only have 3 buttons. (downloads, itunes U, podcasts) how do i get the music, music videos etc. buttons?

    I have bought an iPad 2 recently but when i open itunes, i only have 3 buttons. (downloads, itunes U, podcasts) how do i get the music, music videos etc. buttons?

    Reinstall iOS via iTunes on your computer.

  • How do I get my itunes to access music files on external disc hooked up to my imac?

    how do I get my itunes to access music files on external disc hooked up to my imac?

    assuming copy to ... when adding to library is checkmarked in preferences > advanced, drag the files from the external into an open iTunes window while holding the option (⌥) key.

  • I am picking up my new ipad this morning and turning over my ipa 2 to my wife. how do i get all my info apps, etc to my new ipad and wipe pout all on my existing and then how does she log in register with my old ipad?

    i am picking up my new ipad this morning and turning over my ipa 2 to my wife. how do i get all my info apps, etc to my new ipad and wipe pout all on my existing and then how does she log in register with my old ipad?

    Restore your new iPad from your most recent backup of your iPad2 in iTunes when you set it up, and then set up your wife's iPad2 as new device in iTunes by clicking on 'restore' on the main summary screen.
    Alternatively, you can just go to 'Settings>Reset>Erase all Contents and Settings'.

  • JAAS LoginModule: how to getCurrentUser

    Hallo there everyone!
    I'm creating a custom LoginModule for the WLS 7.0 and I'm trying to get the username
    from the user request. Something like in servlets/jsp request.getRemoteUser()
    or in WLS 6.0 weblogic.security.acl.Security.getCurrentUser() would have done
    the job I think (but it’s been deprecated in 7.0).
    Is there a way of doing this from within the JAAS LoginModule?
    Regards
    Patrick

    request.getRemoteUser() still works fine for me after I implented a custom
    Autthenication / LoginModule.
    "patrik" <[email protected]> wrote in message
    news:[email protected]..
    >
    Yes, I have. see:
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.develo
    per.interest.security&item=8553&utag=
    >
    But if you've managed to get out the information from it I'd be gratefulto know
    how.
    /Patrik
    "Utpal" <[email protected]> wrote:
    Have you tried weblogic.security.Security.getCurrentSubject() ??
    -utpal

  • How can I get path from af: inputFile or a uploadedFile

    Hi, there,
    I am getting error messages while sending attachment.
    I firstly tired getting the attachment from <af:inputFile> and attach it to the email. It failed. Then I put the file name directly into my code, still choose the same file from the <af:inputFile>, it failed again. However, from the code you can see, I can get system out println to print the file name, even the file content.
    I realized that I might need the file path, but I don't konw how I do get the path, should I write code in the backing bean of uploadedFile or in the send() in the Application Module ? How can I get the path?
    any advice is welcome and thank you very much!
    The system.out.println result is
    08/05/09 11:56:38 2javax.activation.FileDataSource@1674b36
    08/05/09 11:56:38 2.1 jkljlj
    08/05/09 11:56:38 2.2New Text Document.txt
    But the error message still says :
    nested exception is:
    class javax.mail.MessagingException: IOException while sending message;
    nested exception is:
    java.io.FileNotFoundException: New Text Document.txt (The system cannot find the file specified)
    Here is my code:
    ViewObject issueView = getIssueView1();
    Row x = issueView.getCurrentRow();
    String fileName = "New Text Document.txt";
    System.out.println("1 " + fileName);
    System.out.println("1.5 " + x.getAttribute("attachmentName"));
    // msg.setText(body);
    MimeBodyPart mbp1 = new MimeBodyPart();
    mbp1.setText(body);
    Multipart mp = new MimeMultipart();
    mp.addBodyPart(mbp1);
    // String attachmentName = (String)x.getAttribute("attachmentName");
    //if (attachmentName != null) {
    MimeBodyPart mbp2 = new MimeBodyPart();
    DataSource source = new FileDataSource(fileName);
    System.out.println("2" + source);
    System.out.println("2.1 " + x.getAttribute("attachment"));
    mbp2.setDataHandler(new DataHandler(source));
    //mbp2.setFileName(source.getName());
    mbp2.setFileName(fileName);
    System.out.println("2.2" + fileName);
    mp.addBodyPart(mbp2);
    msg.setContent(mp);
    // send the message!
    getDBTransaction().commit();
    Transport.send(msg);
    System.out.println("\nMail was sent successfully.");
    } catch (Exception e) {
    System.out.println("Error: " + e.getMessage());
    }

    I wish you and others like you would say what you are trying to do, not how you are trying to do it. That would save those who would like to help the trouble of figuring it out. However, I'm going to make a guess at what you are doing. Tell me if I'm right.
    You are writing a page that lets a user construct an e-mail message. I assume that the page has fields like: addressee, subject, and message. It also has a field, defined as an <af:inputFile> component for getting a file to be added as an attachment to the e-mail.
    You will want to look at forum posts and tutorials about how to upload a file. You will see that the "value" attribute of an <af:inputFile> will normally contain EL referencing a property of a backing bean which has the UploadedFile class. This class has methods for getting the filename, MIME content type, and an InputStream containing the data in the uploaded file. These pieces of information are all you need to add an attachment to an e-mail. You don't need the file's path, which is a good thing, since that information is not available to you.
    I've never used Javamail, so I can't tell you exactly how to use it, but I do understand the basics of sending e-mail. What you are going to do is create a multi-part message. The first part will be the message itself. Subsequent parts are the attachments. Each attachment can have it's filename and MIME content type set. Then you read the file through it's InputStream and write it to the message content. If the file contains binary data, you will need to pass it through a filter that will encode it to the Base64 format - which represents your data as 7 bit bytes.
    You will NOT be using the database connection or anything from the data controls to send an e-mail, unless you also need to save a copy to the database. The connection that is needed for e-mail is a connection to an SMTP service. Ask your e-mail administrator for some help with this.
    You MIGHT want to write most of this code in your Model project as a business component. Then your backing bean would probably just pass the fields as parameters.

  • How can i get the port used for https

    Hi All,
    does aynbody knows how can i get in the portal the port used for https connection, cause the link send by e-mail notification, when user has been invited in a room doesnt work...
    i tried to use the command netstat -ao and i tried use the port that i get there.. but then i get message, when click on the link: "The page cannot be displayed"
    we have following settings:
    server port: ??
    Web Protocol: https://
    Thanks for suggestions!
    Karol

    Hi Karol,
    by navigating to:
    Content Administration -> Collaboration Content -> (Room Administration -> Related Topics) -> Configure Backend Properties for Rooms
    you can change the Webprotocol to http:// and set server port to 50000 (default port).
    To see the SSL Port you can go in the Visual Administrator to Services -> "HTTP Provider Services".
    http://help.sap.com/saphelp_nw04/helpdata/en/a2/f9d7fed2adc340ab462ae159d19509/frameset.htm
    Hope this helps,
    Robert

  • I have to re-install itunes, how can I get all my songs, apps etc back, with no access to my old itunes??

    Itines was deleted from my computer and I need to re-install it but dont want to lose all my songs, apps etc. How can I get all this back onto itunes with no access to my old itunes??

    Itunes was deleted?  Or your itunes library was deleted?
    If it was just itunes, then your music should still be there.  Just reinstall itunes.
    Otherwise just use your backup copy of your comuter to put everything back.

  • How can we get the Latest Resource Assigned in the Approval Form

    I was wondering if there is any way to get the Latest Assigned Resources to a User in my Approval Form.
    I tried this <ref>waveset.resourceAssignments</ref> but it returned all the Resources assigned to a User. While creating a User with Resource Assigned it won�t be problem. While Update when a User is assigned a Resource & it comes for Approval to the owner, all the Previously assigned resources shows up. How can I get only the Latest Resource Assigned.
    Can anyone provide some hints on this..

    idm_guy, if you could elaborate more on what you mean with latest resource assigned it would help - but there are a number of options (if i interprent you correctly to solvethis). My guess is that the easiest way would be to determine if:
    waveset.accounts[<iterate through resources>].created = true or false
    and if
    waveset.accounts[<resource>].lastPasswordUpdate = <last updated date>
    The latter is of course only applicable to resource where you set a password. This value will be updated whenever you set the password and could be a possible value to check against.
    If the account is not created yet but assigned it might be another possibility to check, but again - clairfy a bit about what you mean with "Latest Resource Assigned".
    /Anders

  • I have an iphone5 and no apps can access my camera roll. When i go to privacy settings there is no option to turn it on. How do I get these apps to access my camera roll? I have tried deleting and reinstalling the apps.

    I have a new iPhone 5. I am trying to get apps like instagram, facebook etc to upload pictures from my camera roll. When i try to get a picture from the camera roll it instructs me to go to settings - privacy - photos and turn access on. When I do this, there is no option to turn it on. All i get is a screen saying "apps that have requested access to your photos will appear here". NO APPS APPEAR HERE. When I go to instagram I get the message "this app does not have access to your photos. You can enable access in Privacy Settings." I CAN'T enable it in Privacy Settings. I tried deleting the app and reinstalling it and it didnt work. Please help! Much appreciated.

    I'm also on iPhone 4, iOS 6, and have exactly the same problem. I've tried resetting privacy settings, turning restrictions on and off, deleting and reinstalling apps. Nothing seems to work. The lists of apps in privacy settings are all empty, except for location services. When using Tweetbot the app is regularly asking for permission to access my twitter account, but even when I allow that, the app doesn't show in privacy settings. When I try to go into the camera roll from the Facebook app, the app tells me I have to allow access to the camera roll from the privacy settings - which I can't do since the app is not listed there.

  • How do I get path to show when searching 10.8.5

    When I do a search on my other computers, the window I'm in gives me a "path" at the bottom so that I can find where something is. For some reason on this imac it does not do it. Does anyone know how to find the settings for this?
    Thanks,

    Open Finder.
    Click on Finder / View.
    Click on Show Path Bar.

Maybe you are looking for

  • Partition view on 10g and 11g

    Hi All, I am on 10.2 Standard edition and 11.1 Standard edition (2 databases in the application, one on 10g, another on 11g). Being on standard edition, cannot use many common features e.g. partitioning, bitmap indexes etc. I use to think that, parti

  • NAVS Tax price is not copied when creating a PO using template PO

    Hello, We have the following situation. In our Pricing calculation schema we use condition NAVS for tax calculation. Tax amount is entered automatically when we create a PO (based on condition records found) However, when we create a PO, copying this

  • Footer text shift

    I am having a problem with footer content shifting. In four out of five browsers, my footer text appears outside of the footer at the bottom of the main content but above the footer area. The background image does not move and is in the right locatio

  • Monitor-size previews not monitor-sized

    I'm glad I'm not going mad, like I thought I was. I've recently thought that it is difficult to judge the sharpness of my images in Bridge's full-screen preview. I seem to remember images being sharper in the past, but maybe it's just my perception.

  • Improving performance of a DatabaseAdapter

    I have a DatabaseAdapter setup pulling information from about 8 tables. The tables are hierarchical, going at most 3 levels deep. Anyway, I've noticed that execution time increases exponentially because of the way TopLink generates the SQL queries. A