Skip to Content
author's profile photo Former Member
Former Member

Programatically logging in a user

Hi all

I have created a test html form page, and am calling an abstract portal component that logs in a user into the portal.

I am trying to login a user programatically, and I am using IAuthentication. I tried the code specified in this thread:

Howto log user if i know userID and passwd

but heres what is happening:

1. When I give the username (say, Test1) and password and login, it goes into the portal fine.

2. When I try to login again with another username (say Test2) and password, it logs into the portal using the previous username and password ie, the session for the previous user (Test1) is being used to login to the portal the second time too.

I dont understand...why is this happening? What should I do?

Thanks

J

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 22, 2008 at 09:00 AM

    Hi,

    You should first logoff the current user before you can login with other user.

    So try the methods:

    logout and forceLogoffUser from ILogonAuthentication depending upon your need:

    http://help.sap.com/javadocs/NW04s/current/se/com/sap/security/api/logon/ILogonAuthentication.html

    Regards,

    Praveen Gudapati

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi All

      This actually works perfectly in IE, but not in Mozilla. In Mozilla, it logs me in fine every alternate time, and every other time it redirects me to the default login page.

      Would anyone know what can be tried?

      Thanks

      OJ

  • author's profile photo Former Member
    Former Member
    Posted on May 27, 2008 at 06:37 AM

    That was a problem with my mozilla browser!

    Thanks

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.