|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Extension from IAuthentication that provides more powerful authentication services.
| Method Summary | |
IAuthScheme[] |
getAuthSchemes()
Returns the names of teh available auth schemes. |
ILogonFrontend |
getLogonFrontend(java.lang.String authSchemeName)
Returns the LogonFrontend for the auth scheme. |
boolean |
isAuthenticated(IUser user)
Check if the current user is already authenticated, i.e. |
boolean |
isAuthSchemeSufficient(IUser user,
java.lang.String authscheme)
Checks if the current logged in user has satisfied the autscheme with name
authscheme. |
javax.security.auth.Subject |
logon(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
java.lang.String authscheme)
Function that is intended for programmatic logon. |
| Methods inherited from interface com.sap.security.api.IAuthentication |
forceLoggedInUser, forceLogoffUser, getLoggedInUser, logout |
| Methods inherited from interface com.sap.security.api.IConfigurable |
initialize |
| Method Detail |
public javax.security.auth.Subject logon(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp,
java.lang.String authscheme)
throws javax.security.auth.login.LoginException
IAuthentication.forceLoggedInUser(HttpServletRequest,HttpServletResponse ).
The function follows
the specific syntax: The parameter authscheme determines which
logon variant will be used, e.g. which authentication mechanism will be used.
The standard mechanism does the following: Looks up for the parameter
j_user
and j_password (pls. see the constants ILoginConstants.LOGON_UID_ALIAS
and ILoginConstants.LOGON_PWD_ALIAS) in the servlet request and uses them for logon
against the user repository that's configured. On successful return (i.e. if
no exception is being thrown) a Subject is returned. In order to get an
IUser object from this subject, call
Subject.getPrincipals() and
iterate through the returned Set of principals.For error situations please see the below list of possible exception
req - HttpServletRequestresp - HttpServletResponseauthscheme - The name of the authscheme to perform logon.null otherwise.javax.security.auth.login.LoginException - if the logon fails. The message of the exception is the
key for the error message.
public boolean isAuthSchemeSufficient(IUser user,
java.lang.String authscheme)
authscheme.user - object returned by IAuthentication.getLoggedInUser(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse).authscheme - authscheme to be satisfiedtrue if yes, false if not.public ILogonFrontend getLogonFrontend(java.lang.String authSchemeName)
authSchemeName - name of the auth schemenullpublic IAuthScheme[] getAuthSchemes()
public boolean isAuthenticated(IUser user)
IUser
object is result of an authentication process (it could also have been created by
something like UMFactory.getInstance().getUserFactory().getUser (...)).user - user to check.true if authenticated, otherwise false.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||