2

I trying to create a servlet to logout from multiple JSF applications running on Oracle Glassfish. I tried the following code,

weblogic.servlet.security.ServletAuthentication.logout(request);
weblogic.servlet.security.ServletAuthentication.invalidateAll(request);
weblogic.servlet.security.ServletAuthentication.killCookie(request);

but I am not able to find the JAR file containing the required class in order to get the code to compile. I downloaded Oracle WebLogic and tried various of its JARs, but no one of them made the code to compile.

Which JAR does contain the required class and where can I find it?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
user2240516
  • 21
  • 1
  • 1
  • 5
  • 2
    You are trying to use Weblogic specific authentication functionality in a Glassfish server? I don't think that will ever work. You will have to figure out how to implement authentication and session management on Glassfish instead. This is the problem you will run into when developing Java EE applications on vendor specific application server libraries. – maple_shaft Apr 03 '13 at 13:38
  • Maple Thanks for the response, I understand but why I tried this mechanism, because for logout if I was using session.invalidate() it was not actually logging out the user, so is there any other method that I can complete logout and expire all the sesion of current user. If you can post a piece of code, i'll much appreciate.thanks – user2240516 Apr 03 '13 at 13:44
  • Warning: this question is a classic example of the [XY problem](http://meta.stackexchange.com/questions/66377/what-is-the-xy-problem). – BalusC Apr 05 '13 at 11:47

3 Answers3

2

The class you are looking for is in a jar named wls-api.jar.

However, you're probably searching for the wrong thing because if you are developing applications to run on Glassfish you should stick with the standard techniques (e.g. JSR-196 described here or here).

Because it isn't obvious what you are trying to implement I can't give any further detailed advice but there is plenty of documentation available about Java EE Security.

unwichtich
  • 13,712
  • 4
  • 53
  • 66
  • Hi Thanks, I understand what you mean to say, can you provide me example how to completely logout as i figured out session.invalidate is not actually logging out user...can you please post a code if you have it for logout and session expiry...thanks in advance – user2240516 Apr 03 '13 at 13:54
  • This depends on the code you already have, especially how you do your login. I guess it would be better to update your question (or create a new one) with some sample code how the login is done so people can analyze and show you a way to do the logout... – unwichtich Apr 03 '13 at 13:57
  • Hi tell you more about my code...that when I run my application an alert pops up from glassfish server and asks for username and password..please let me know how to completely logout in this case. – user2240516 Apr 03 '13 at 15:49
  • I am using file realm authentication...help for logout..how to logout even i destroyed the session but nothing seems to work..after first login server no more asking to login next time for authentication. – user2240516 Apr 04 '13 at 10:32
0

I think u need this jar file:

<JDeveloper Home>\Middleware\wlserver_10.3\server\lib\weblogic.jar

Jeff Wolski
  • 6,332
  • 6
  • 37
  • 69
Ivan
  • 1
0

The file is located at <WLS_HOME>\middleware\wlserver\server\lib\wls-api.jar

michael_demonio
  • 188
  • 1
  • 2
  • 10