Topic
  • 4 replies
  • Latest Post - ‏2012-06-27T17:26:04Z by SystemAdmin
SystemAdmin
SystemAdmin
570 Posts

Pinned topic Urgent Help - Custom Authentication

‏2012-06-18T22:40:37Z |
Hi,

I wrote a custom authentication which reads LTPA Tokens (cookies).
Now how do I request to portal page with the LTPA Tokens?

Thanks
  • SystemAdmin
    SystemAdmin
    570 Posts

    Re: Urgent Help - Custom Authentication

    ‏2012-06-20T18:42:42Z  
    So to make sure that I completely understand your question, you now have the LTPA token that you have acquired by using your own custom written login module and authenticator and you would like to accomplish one or both of the following:

    1. Navigate to another page and pass the LTPA token to this new page to use for authentication
    2. Make an call using an HTTP adapter and passing the token with the adapter call

    Please let me know if you are trying to do one or both of these above and I will be able to give you a solution. If this is not what you are trying to do, please provide a few more specific details about what you are trying to accomplish.

    Thanks.
  • SystemAdmin
    SystemAdmin
    570 Posts

    Re: Urgent Help - Custom Authentication

    ‏2012-06-20T19:42:12Z  
    So to make sure that I completely understand your question, you now have the LTPA token that you have acquired by using your own custom written login module and authenticator and you would like to accomplish one or both of the following:

    1. Navigate to another page and pass the LTPA token to this new page to use for authentication
    2. Make an call using an HTTP adapter and passing the token with the adapter call

    Please let me know if you are trying to do one or both of these above and I will be able to give you a solution. If this is not what you are trying to do, please provide a few more specific details about what you are trying to accomplish.

    Thanks.
    Hi,

    You are right. After the custom login module and authenticator,
    I am trying to do the first point; 1) Navigate to another page and pass the LTPA token(set the LDAP Token as cookies) to this new page to use for authentication.

    Thanks
  • SystemAdmin
    SystemAdmin
    570 Posts

    Re: Urgent Help - Custom Authentication

    ‏2012-06-21T20:24:04Z  
    Hi,

    You are right. After the custom login module and authenticator,
    I am trying to do the first point; 1) Navigate to another page and pass the LTPA token(set the LDAP Token as cookies) to this new page to use for authentication.

    Thanks
    All you need to do is pass the cookie into the response once you have read it. Here is a small bit of rough (untested) code that illustrates this

    public AuthenticationResult processRequest(HttpServletRequest request, HttpServletResponse response, boolean isAccessToProtectedResource) throws IOException, ServletException {

    .....
    Cookie cookie = request.getCookie("LtpaToken");
    response.addCookie(cookie);

    .......

    }

    Your application will now pass your cookie in its response and subsequent responses. Please let me know if this works for you.
  • SystemAdmin
    SystemAdmin
    570 Posts

    Re: Urgent Help - Custom Authentication

    ‏2012-06-27T17:26:04Z  
    All you need to do is pass the cookie into the response once you have read it. Here is a small bit of rough (untested) code that illustrates this

    public AuthenticationResult processRequest(HttpServletRequest request, HttpServletResponse response, boolean isAccessToProtectedResource) throws IOException, ServletException {

    .....
    Cookie cookie = request.getCookie("LtpaToken");
    response.addCookie(cookie);

    .......

    }

    Your application will now pass your cookie in its response and subsequent responses. Please let me know if this works for you.
    Hi,

    Let me give you more information about my issue.

    Lets assume https://ibm.com/wps/myportal is portal site. If I type that URL on the browser then It will display the login page, after entered the userid/password then it will display the Portal Home page.

    I am trying to write a Worklight application (mobile application using Worklight, not accessing through mobile browser ), which provide the login screen and after entered userid/password then worklight has to redirect to Portal Home page.
    For that I wrote a custom login module to read the LTPA Tokens for https://ibm.com/wps/myportal URL and I successfully got the LTPA Tokens. Now I have to redirect to https://ibm.com/wps/myportal URL by setting LTPA Tokens as cookies.

    Basically I am just providing login application which authenticate Portal Server and display the content. I don't have any control of modifying the Portal Server information.

    So my issue is that after authenticated using custom login module, how to I access the Portal Server Home page?

    Is there Worklight Client API provide a functionality to redirect the request?

    Thanks