The SAP NetWeaver Application Server (AS) Java provides interfaces to get details about the current user.
The user management factory provides access to the user management functions. The user management factory is in the following package:
com.sap.security.api.UMFactory
The IUser interface provides read access to the available user information.
Examples for user information:
● Company the user belongs to.
● Profile information, like full name and address)
● Authorization information. Which rights does the user have.
The IUserMaintinterface extends the IUser interface and provides methods to change the user information.
The user management factory provides several methods to get the IUser object, for example, get user by user name. For all available methods, refer to the Java Docs.
You
can access the logon ID by iterating through the IUserAccounts array that is returned by
method getUserAccounts()
, with method getLogonUid()
.
IUserAccount accounts[]= null; |