Form Auth with HttpClient 4.01 and JAVASSO Partnering Application

I am using Apache Commons HttpClient 4.01 and tyring to perform a form authentication against a web application that is a OC4J 10.1.3 instance using JavaSSO Partnering Application. The stock Login provided by 10.1.3 has 'j_security_check', 'j_username' and 'j_password' form fields.
I am doing a post against the SSOLogin page - (Sample) http://my.localhost.com/jsso/SSOLogin:
<form action="j_security_check" name="loginForm" method="post">
<input class="inputBox" type="text" id="username" name="j_username" maxlength="64" tabindex="1"/>
<input class="inputBox" type="password" id="password" name="j_password" maxlength="64" tabindex="2"/>
<input class="submit" type="submit" name="submit" value="Login" tabindex="3"/>
</form>
Here's the code I'm using to post:
DefaultHttpClient httpclient = new DefaultHttpClient();
HttpGet httpget = new HttpGet("http://my.localhost.com/jsso/SSOLogin");
HttpResponse response = httpclient.execute(httpget);
HttpEntity entity = response.getEntity();
EntityUtils.consume(entity);
List<Cookie> cookies = httpclient.getCookieStore().getCookies();
HttpPost httpost = new HttpPost("http://my.localhost.com/jsso/SSOLogin");
List<NameValuePair> formParams = new ArrayList<NameValuePair>();
formParams.add(new BasicNameValuePair("j_username", "testuser"));
formParams.add(new BasicNameValuePair("j_password", "testpassword123"));
UrlEncodedFormEntity urlCode = new UrlEncodedFormEntity(formParams, HTTP.UTF_8);
httpost.setEntity(urlCode);
response = httpclient.execute(httpost);
entity = response.getEntity();
For whatever reason the page does execute the action tied to 'j_security_check'. I've tried the same code against other sites that use form authentication and it works OK. Is there anything concerning OC4J 10.1.3 and JAVASSO Partnering Application I'm overlooking?
Any insight would be appreciated.

The JavaSSO login is using standard form based login. This means that the client has to be session aware. When the login page (http://my.site.com/jsso/SSOLogin) is accessed, cookie will be set. Ensure that the cookie is set back on the next request sent to the server. The username and password credentials should be posted to http://my.site.com/jsso/j_security_check and not to the URLs you attempted.

Similar Messages

  • Basic auth with RESTful WEb service and Web Service reference

    Hi, All,
    We have made much progress on getting an application working wtih RESTful web services but now are trying to figure out how to lock down a RESTful Web service while making it available for a particular application.
    We are using one of the sample 'emp' table web services that come with Apex 4.2 and are trying to apply Basic Auth to the WEb Service via Weblogic filter defined in the web.xml file. That works fine. I now get challenged when I try to go to :
    https://wlogic.edu/apex/bnr/ace/hr/empinfo/
    And when I authenticate to that challenge I am able to get the data. (we are usiing LDAP authentication at the Weblogic level)
    However, I am not sure how to get same basic authentication to work with the Web Service reference in my application. I see the error message in the application when I try to call that Web Service:
    401--Unauthorized<
    And I see:
    "The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.46) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials"
    How do I provide the credentials in the Web REference or do I provide credentials in the Application?
    Web service works fine if I remove the RESTful web service basic auth from the Web.xml file.
    Should we NOT use Weblogic basic auth and instead use basic auth from Workspace RESTful web service definition. If so, how do we implement THAT basic auth in the Web Service definition and in the Web SErvice Reference on the application?
    Thanks,
    Pat

    What I mean is diid you try to use the PL/SQL package for APEX webservice. Here is an example I use (modified and shortened, just to show how much better this is than to use it from the application).
    CREATE OR REPLACE PACKAGE webservice_pkg
    IS
       PROCEDURE create_webservice (
          p_id            IN       NUMBER,
          p_message       OUT      VARCHAR2,
          p_workspace     IN       VARCHAR2 DEFAULT 'MY_WORKSPACE',
          p_app_id        IN       NUMBER DEFAULT v ('APP_ID'),
          p_app_session   IN       VARCHAR2 DEFAULT v ('SESSION'),
          p_app_user      IN       VARCHAR2 DEFAULT v ('APP_USER')
    END webservice_pkg;
    CREATE OR REPLACE PACKAGE BODY webservice_pkg
    IS
       PROCEDURE set_credentials (
          p_workspace     IN   VARCHAR2,
          p_app_id        IN   NUMBER,
          p_app_session   IN   VARCHAR2,
          p_app_user      IN   VARCHAR2
       IS
          v_workspace_id   NUMBER;
       BEGIN
          SELECT workspace_id
            INTO v_workspace_id
            FROM apex_workspaces
           WHERE workspace = p_workspace;
          apex_util.set_security_group_id (v_workspace_id);
          apex_application.g_flow_id := p_app_id;
          apex_application.g_instance := p_app_session;
          apex_application.g_user := p_app_user;
       END set_credentials;
       PROCEDURE create_webservice (
          p_id            IN       NUMBER,
          p_message       OUT      VARCHAR2,
          p_workspace     IN       VARCHAR2 DEFAULT 'MY_WORKSPACE',
          p_app_id        IN       NUMBER DEFAULT v ('APP_ID'),
          p_app_session   IN       VARCHAR2 DEFAULT v ('SESSION'),
          p_app_user      IN       VARCHAR2 DEFAULT v ('APP_USER')
       IS
          v_envelope          VARCHAR2 (32000);
          v_server            VARCHAR2 (400);
          v_url               VARCHAR2 (4000);
          v_result_url        VARCHAR2 (1000);
          v_collection_name   VARCHAR2 (40)    := 'PDF_CARD';
          v_message           VARCHAR2 (4000);
          v_xmltype001        XMLTYPE;
       BEGIN
          v_url := v_server || '.myserver.net/services/VisitCardCreator?wsdl';
          FOR c IN (SELECT *
                      FROM DUAL)
          LOOP
             v_envelope :=
                   '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" '
                || 'xmlns:bran="http://www.myaddress.com">'
                || CHR (10)
                || '<soapenv:Header/><soapenv:Body>'
                || CHR (10)
                || '<parameter:'
                || 'some_value'
                || '>'
                || CHR (10)
                || '<bran:templateID>'
                || p_id
                || '</bran:templateID>'
                || '</soapenv:Body>'
                || CHR (10)
                || '</soapenv:Envelope>';
          END LOOP;
          set_credentials (p_workspace, p_app_id, p_app_session, p_app_user);
          BEGIN
             apex_web_service.make_request
                                         (p_url                  => v_url,
                                          p_collection_name      => v_collection_name,
                                          p_envelope             => v_envelope
             p_message := 'Some message.';
          EXCEPTION
             WHEN OTHERS
             THEN
                v_message :=
                      v_message
                   || '</br>'
                   || 'Error running Webservice Request. '
                   || SQLERRM;
          END;
          BEGIN
             SELECT    v_result_url
                    || EXTRACTVALUE (VALUE (t),
                                     '/*/' || 'Return',
                                     'xmlns="http://www.myaddress.com"'
                    xmltype001
               INTO v_result_url,
                    v_xmltype001
               FROM wwv_flow_collections c,
                    TABLE
                        (XMLSEQUENCE (EXTRACT (c.xmltype001,
                                               '//' || 'Response',
                                               'xmlns="http://www.myaddress.com"'
                        ) t
              WHERE c.collection_name = v_collection_name;
          EXCEPTION
             WHEN OTHERS
             THEN
                v_message := v_message || '</br>' || 'Error reading Collection.';
          END;
       EXCEPTION
          WHEN OTHERS
          THEN
             p_message := v_message || '</br>' || SQLERRM;
       END create_webservice;
    END webservice_pkg;
    /If you use it this way, you will find out what the problem is much faster.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.apress.com/9781430235125
    http://apex.oracle.com/pls/apex/f?p=31517:1
    http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
    -------------------------------------------------------------------

  • Email form script with custom text field and drop-down menu?

    Hey, I'm building a website in iWeb - http://dl.dropbox.com/u/19707357/Website/craftpackage.html
    And I was looking for a script that could possibly send an email to me with the info a user chooses from/puts in 1. dropdown menu 2. text field 3. another text field. I'd be awesome if the fields could have a custom background or a transparent background.The drop-down menu could have any background, but it would be awesome if it could be made with custom images !

    Basic question.
    What have you yourself done to find out?
    Nothing?
    Start here :
    http://www.google.com/search?q=how+to+make+a+mail+form
    http://www.google.com/search?q=dropdown+menu+with+transparent+background
    Unfortunately, it has no dropdown menu :
    http://www.wyodor.net/blog/archives/2010/01/entry_301.html
    Btw, dropdown menus in forms at select menus. These are not the same.
    http://www.google.com/search?q=select+menu+form
    http://http://www.w3schools.com/html/html_forms.asp
    So start practicing and once everything works the way it should, display it in a html snippet.

  • Creating a form field with Arial MS Unicode and Identity-H encoding

    I need to create a text field on an Adobe Acrobat form that has a font of Arial Unicode MS with the font encoding being set to Identity-H. However when I use Adobe Acrobat 9 Standard (v9.5.1) to do this the encoding is always set to UniKS-UTF16-H. I can't find a way of changing the encoding  to Identity-H. Any suggestions on how I can achieve this.

    I have a 3rd party form filling app that needs the encoding set to identity-h to support the range of characters that could be input. I could ask the vendor to change the app to fix the problem but there would be significant process involved in that. I have a small demo that shows that creating a form with the encoding set to identity-h provides a resolution. The demo was created with iText but as the real form is considerably more complicated I'd rather not use iText if I don't have to. Since the form was originally created with acrobat the question remains as this would be the "least painful" route to a resolution.

  • One JSP Coded in JSTL with an Action Link and a Form

    My JSP written in JSTL with an action link works fine. The checkboxes are well recognized ( I have a "form" specified in both the action mapping and form bean).
    <%@ page import="......common.pojo.user.User" %>
    <!-- Create a variable in scope called userRows from the Users object -->
    <c:set var="userRows" value="${requestScope.Users}" />
    <c:choose>
         <c:when test="${not empty userRows}">
              <!-- create a "user" object for each element in the userRows -->               
              <c:forEach var="user" items="${userRows}" varStatus="idx">
                      <c:choose>
                              <c:when test="${( idx.count+1 )%2==0}">
                                 <tr class="contentCell1">
                              </c:when>
                              <c:otherwise>
                                 <tr class="contentCell2">
                              </c:otherwise>
                      </c:choose>
                                           <td align="center">
                                                              <html-el:checkbox property="selectedUsers[${idx.index}].selected" />
                                                              <html-el:hidden property="selectedUsers[${idx.index}].id" value="${user.id}"/>
                                           </td>
                                           <td align="center"><c:out value="${user.createdByUserID}" /></td>
                                           <td align="center"><c:out value="${user.firstName}" /></td>
                                           <td align="center"><c:out value="${user.lastName}" /></td>
                             </tr>
              </c:forEach>
                        <tr>
                             <td colspan="6" align="left">
                                      <html-el:link action="/admin/selectUsers.do">Edit Selected Users</html-el:link>
                             </td>
                           </tr>
                   </table>
              </c:when>
              <c:otherwise>
                   <center><H1>No User Found.</H1></center>
              </c:otherwise>
         </c:choose>
    ......But, if I add another form (form B) with some textfield(s) and a submit button in between the opening <c:when ...> and <c:forEach ... > tag, I get the "runtime" JSP error: "cannot find bean: "org.apache.struts.taglib.html.BEAN" in any scope".
    The form B also works well. And varStatus="idx" and var="user" still work. The complaint points specifically to the <html-el:checkbox property="selectedUsers[${idx.index}].selected" />. The getter method for selectedUsers[0].selected can no longer be recognized:
    <%@ page import="......common.pojo.user.User" %>
    <!-- Create a variable in scope called userRows from the Users object -->
    <c:set var="userRows" value="${requestScope.Users}" />
    <c:choose>
         <c:when test="${not empty userRows}">
                                    <html-el:form action="/admin/findUsers.do">
                                               // many textfields and a submit button
                                    </html-el:form>
              <!-- create a "user" object for each element in the userRows -->               
              <c:forEach var="user" items="${userRows}" varStatus="idx">
                      <c:choose>
                              <c:when test="${( idx.count+1 )%2==0}">
                                 <tr class="contentCell1">
                              </c:when>
                              <c:otherwise>
                                 <tr class="contentCell2">
                              </c:otherwise>
                      </c:choose>
                                           <td align="center">
                                                              <html-el:checkbox property="selectedUsers[${idx.index}].selected" />
                                                              <html-el:hidden property="selectedUsers[${idx.index}].id" value="${user.id}"/>
                                           </td>
                                           <td align="center"><c:out value="${user.createdByUserID}" /></td>
                                           <td align="center"><c:out value="${user.firstName}" /></td>
                                           <td align="center"><c:out value="${user.lastName}" /></td>
                             </tr>
              </c:forEach>
                        <tr>
                             <td colspan="6" align="left">
                                      <html-el:link action="/admin/selectUsers.do">Edit Selected Users</html-el:link>
                             </td>
                           </tr>
                   </table>
              </c:when>
              <c:otherwise>
                   <center><H1>No User Found.</H1></center>
              </c:otherwise>
         </c:choose>
    ......

    Hi,
    your strtus config file looks like
    <form-beans >
    <form-bean name="manageAuditFindingsForm" type="com.lib.struts.form.ManageAuditFindingsForm" />
    </form-beans >
    <action
          attribute="manageAuditFindingsForm"
          input="/New.jsp"
          name="manageAuditFindingsForm"
          path="/manageauditfindings"
          scope="request"
          type="com.lib.struts.action.ManageAuditFindingsAction">
          <forward name="success" path="/AuditFindings.jsp" />
        </action>Thanks
    Edward

  • Can't combine a IRS fillable form pdf with Acrobat XI

    In past years I have combined an IRS fillable form pdf with attachments before printing and archiving.
    However, this year I contine to get an error message.
    Not sure if it is XI vs X or new type of pdf by IRS but I'm a Acrobat relative beginner and need some assist.
    Maybe just operator error.
    This is the dialog that I keep getting:
    Any tips greatly appreciated.
    Thank you.

    Thank you.
    Yes, it is created by Adobe LCD ES 8.2.
    I don't see the type of document. Probably staring at me. Sorry.
    Can I convert or somehow get around this?
    Last year's looks to be the same type of animal but I was using Acrobat X. Would that make a difference?
    This beginner, old beginner , appreciates the help.

  • Form Guide with Embedded xdp?

    Hi all,
    is there a way to embed an Xdp within a panel in a form guide?
    I'd like to have a form guide with some input panels and then on a specific panel i want to open an xdp so that the user can fill data in it, but always within the guide style.
    Is it possible?
    Thank you all.
    Alessio

    Thanks for your answer :)

  • 6.0 form auth and auto logout

    Hi,
    I have recently started using 6.0 and have configured security to
    force form auth.
    I start the server and then I open a browser and login via the form.
    I have noticed that after around 1.5 hours of inactivity, I get logged
    out. The current user is set to
    "guest" and I am returned to the login form.
    Is this new with 6.0? How can the timeout be configured? Is the
    timeout only based on inactivity or is it just periodic?
    Thanks,
    Rob
    [email protected]

    Rob Appelbaum wrote:
    Hi,
    I start the server and then I open a browser and login via the form.
    I have noticed that after around 1.5 hours of inactivity, I get logged
    out. The current user is set to
    "guest" and I am returned to the login form.
    Is this new with 6.0? How can the timeout be configured? Is the
    timeout only based on inactivity or is it just periodic?
    Rob,
    This is not new behavior. It is straight from the servlet spec. It
    happens after a certain amount of inactivity and is set using the
    session-timeout element of the web.xml deployment descriptor.
    HTH.
    Tom Mitchell
    [email protected]
    Very Current Stoneham, MA Weather
    http://www.tom.org

  • Jbo.security.enforce and FORM Auth

    i have web application on JHeadStart with FORM based auth.
    when i change jbo.security.enforce = None to
    jbo.security.enforce = Auth i ha exception:
    Authentication failed:
    User null does not exist in system.
    why?

    This sounds like a OC4J/J2EE issue that is not related to JHeadstart. To simplify the test case, you could create a simple drag-and-drop ADF application without JHeadstart, use that as the 2nd application, and see if the same problem occurs there. Can you please log a TAR at MetaLink ( http://metalink.oracle.com/ ), or ask this question at the OC4J/J2EE forum at OC4J ? Thanks.
    kind regards,
    Sandra Muller
    JHeadstart Team
    Oracle Consulting

  • Form Auth and Russian Language

    I have a probleme with Form based Auth. When i try edit data , my encoding is broken
    why?
    when i off form auth - i edit data normal

    i have web application with Master - Detail relationship. I can add and edit data. Then i add BASIC auth , i can add and edit data too, but when i change BASIC auth to FORM auth (jsp/UIX - same) i have probleme
    with edit/add data- my data is broken - i see (????) instead of my russian language. Why?
    in web.xml i add cp1251 and UIX page with 1251 encoding
    but i have probleme with Form ayth
    it's mysticism for me :-))

  • Is there a way to create a PDF form that ANYONE can fill out and SAVE with their content?

    Is there a way to create a PDF form that ANYONE can fill out and SAVE with their content? By anyone, I mean someone who can download and use the free Adobe Reader, on either a Mac or PC. I have Acrobat Pro, and would like to be able to create forms that can not only be filled out and printed, but saved and emailed, which is not an option with the forms I have created to date. They can be filled out, but not saved, with Adobe Reader.
    TIA,
    Nancy

    To do what Dave indicated you need to do, it depends on what version of Acrobat you have:
    Acrobat 8: Advanced > Enable Usage Rights in Adobe Reader
    Acrobat 9: Advanced > Extend Features in Adobe Reader
    Acrobat 10: File > Save As > Reader Extended PDF > Enable Additional Features
    Acrobat 11: File > Save as Other > Reader Extended PDF > Enable More Tools (includes form fill-in & save)
    I wonder what it will be next time?

  • TS1646 hello  I have problem with regist my visa and I cannot buy from store the message came in the end of form is says the phone number must be a 7-digit number and I have writed but not accepted iam from saudi arabia my mobile is 966504850992 pls answe

    hello 
    I have problem with regist my visa and I cannot buy from store
    the message came in the end of form is says
    the phone number must be a 7-digit number
    and I have writed but not accepted
    iam from saudi arabia
    my mobile is 966504850992
    pls answer
    thanks
    dfr aldossary

    Wow, Karan Taneja, you've just embarrassed yourself on a worldwide support forum.  Not only is your post ridiculous and completely inappropriate for a technical support forum, but it also shows your ignorance as to whom you think the audience is.  Apple is not here.  It's users, like you. 
    If you would have spent half the time actually reading the Terms of Use of this forum that YOU agreed to by signing up to post, as you did composing that usesless, inappropriate post, you (and the rest of us on this forum) would have been much better off.

  • Created a 20 page fill-in the blank form with livecycle 8.0 and now page 20 needs updated.

    Created a pdf with acrobat 8.0 and used livecycle 8.0 to create a fill in the form document.  Now that I am at page 20, the lines i put in for a description for people who still use a typewriter should have been taken out for this document.  Is there any way to replace this page with a revised pdf page.  When I open the document in aapro and select document the insert page is not highlighted.  I know I have deleted and inserted pages before, but not one that went into livecycle.  Can it be done or do I have to start all over again?

    Since this PDF is based on a LiveCycle Designer template individual pages cannot be removed.  Can you not just go back into Designer and remove the page you don't want anymore and add in a new one?

  • Fill in form created in Adobe 8 (Mac) and then trying to send out from PC with adobe 9 pro

    I created a form using adobe acrobrat 8 pro on a mac (everything works and we have used in the past).  I need to send it out from a PC which has adobe acrobat pro 9.  I can open the form, view it and use the distribute feature (via email option).  Then I send it out and when we test the completed form coming back to the email on the PC (using a submit button option), it opens the PDF file, you can view the filled in data on the PDF however the dialog box that normally opens asking if you want to download or import the data does not appear, not even the form tracker dialog box appears - nothing happens.  You can't seem to do anything with the data from the form.  You can only view it. We need to be able to collect it in one file, and then export to a CSV.
    Is there some compability issue between forms created between two platforms, and two different versions?
    Am I missing a step on a PC.  I am not very familiar with a PC's and it doesn't seem to be as drag and drop oriented as a mac.
    Do  I need to rebuild the form on the PC using adobe acrobat pro 9?

    Please post this in the Acrobat support area, you'll get a better answer!

  • Form report with both edit and column link

    hi experts,
    How can we create form report with both edit and column link. Ie, the form should have both the Edit link and column link. When we click on the edit link(in page1) it should go for the page2 and the page2 should display the corresponding row fields which should be editable. but when i click the column link it should bring me to the next page but the corresponding values of the column should not be editable.
    Regars,
    KK

    hi,
    Here i have achieved this by making the column link and page navigation.

Maybe you are looking for

  • LabView

    I've just discovered this newsgroup, and looking at the questions I'm astonished at the sheer difficulty of doing the simplest thing in LabView. Downloading a special toolkit just to use a right mouse click?!!! Messing about with extra nodes to const

  • EBay web page problem - search for item last time was ok now not ok ! I copied and pasted into IE it worked ok but not on Firefox !! why ???

    I have lots of tabs of eBay search pages which I update every day and from last night (26th Sep) and even now 27th they still have the same problem that the search does not continue but goes to a eBay home page ! I tried going back in history but the

  • Re: Print Preview is not opening for a user..!!

    Dear  SAP Members, We have modified authorizations for a user,now the issue is when the user wants to take a report say production order by clicking the print preview option, it says * No authorization,Authorization is being used by another person*.H

  • How to delete a field

    Hi, I have a table t1 in the table t1 i have a field f1, how to delete the data of field f1.

  • Custom pods for 7.0 and 7.5

    I am looking for 7.0 or 7.5 Stage Light or Count Down custom pods. The exchange, http://www.adobe.com/cfusion/exchange/index.cfm?from=1&o=desc&event=productHome&s=5&exc=14, has pods for 8.0. I am still working off 7.0 and 7.5.