Class HttpRequestAttributeAuthenticationMethod
java.lang.Object
dev.getelements.elements.servlet.security.HttpRequestAttributeAuthenticationMethod
- All Implemented Interfaces:
UserAuthenticationMethod
public class HttpRequestAttributeAuthenticationMethod
extends Object
implements UserAuthenticationMethod
Uses a property on the
HttpServletRequest to supply the User. The auhenticated
user is set to the request using ServletRequest.setAttribute(String, Object) using
User.USER_ATTRIBUTE as the key.
Created by patricktwohig on 6/26/17.-
Field Summary
Fields inherited from interface dev.getelements.elements.sdk.model.security.UserAuthenticationMethod
UNPRIVILEGED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionattempt()Attempts authorization.jakarta.servlet.http.HttpServletRequestvoidsetHttpServletRequest(jakarta.servlet.http.HttpServletRequest httpServletRequest)
-
Constructor Details
-
HttpRequestAttributeAuthenticationMethod
public HttpRequestAttributeAuthenticationMethod()
-
-
Method Details
-
attempt
Description copied from interface:UserAuthenticationMethodAttempts authorization. If authorization fails, then this must throw an instance ofForbiddenException. Subsequence methods may be used before finally failing authentication with aForbiddenException.- Specified by:
attemptin interfaceUserAuthenticationMethod- Returns:
- the
User, never null
-
getHttpServletRequest
public jakarta.servlet.http.HttpServletRequest getHttpServletRequest() -
setHttpServletRequest
@Inject public void setHttpServletRequest(jakarta.servlet.http.HttpServletRequest httpServletRequest)
-