SAP NetWeaver 7.1 Composition Environment

com.sap.security.api
Interface IAuthentication

All Superinterfaces:
IConfigurable
All Known Subinterfaces:
ILogonAuthentication

public interface IAuthentication
extends IConfigurable

This interface retrieves the user information of currently logged-in user. Please see also ILogonAuthentication


Method Summary
 IUser forceLoggedInUser(HttpServletRequest req, HttpServletResponse resp)
          Checks whether the user is currently logged in and returns an implementation of IUser
 void forceLogoffUser(HttpServletRequest req, HttpServletResponse resp, String url)
          Logoff user by invalidate the user session and deleting the authentication cookies.
 IUser getLoggedInUser()
          Checks whether the user is currently logged in and returns an implementation of IUser.
 IUser getLoggedInUser(HttpServletRequest req, HttpServletResponse resp)
          Deprecated. Use getLoggedInUser() instead.
 void logout(HttpServletRequest req, HttpServletResponse resp)
          Logouts current user.
 
Methods inherited from interface com.sap.security.api.IConfigurable
initialize
 

Method Detail

forceLoggedInUser

IUser forceLoggedInUser(HttpServletRequest req,
                        HttpServletResponse resp)
Checks whether the user is currently logged in and returns an implementation of IUser

If the user is not yet logged in, a respective logon page is written as ServletResponse. In that case (i.e. null is returned) the calling servlet can simply end their doGet or doPost method with return.

Example:

 IUser uid = forceLoggedInUser(req,res);
 if (uid == null) return;
 

Parameters:
req - HttpServletRequest
resp - HttpServletResponse
Returns:
The currently logged in IUser object or null otherwise.

getLoggedInUser

IUser getLoggedInUser()
Checks whether the user is currently logged in and returns an implementation of IUser. If no user is currently logged in, the default guest user is returned (defined in property ume.login.guest_user.uniqueids).

Returns:
The currently logged in IUser object or the default guest user otherwise.

getLoggedInUser

IUser getLoggedInUser(HttpServletRequest req,
                      HttpServletResponse resp)
Deprecated. Use getLoggedInUser() instead.

Checks whether the user is currently logged in and returns an implementation of IUser If no user is currently logged in null is returned.

Parameters:
req - HttpServletRequest
resp - HttpServletResponse
Returns:
The currently logged in IUser object or null otherwise.

logout

void logout(HttpServletRequest req,
            HttpServletResponse resp)
Logouts current user.

Some cookies will be deleted in the HttpServletResponse.

Parameters:
req - HttpServletRequest
resp - HttpServletResponse

forceLogoffUser

void forceLogoffUser(HttpServletRequest req,
                     HttpServletResponse resp,
                     String url)
Logoff user by invalidate the user session and deleting the authentication cookies.

The user will also be sent to a logoff page which acknowledges that a logoff has taken place with a link for the user to logon again.

Example:

 forceLogoffUser(req, res, returnURL);
 

Parameters:
req - HttpServletRequest
resp - HttpServletResponse
url - url to use to logon again.

SAP NetWeaver 7.1 Composition Environment

Copyright © 2007 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.