Class CorsAuthorizer
- java.lang.Object
-
- org.pac4j.core.authorization.authorizer.CorsAuthorizer
-
- All Implemented Interfaces:
Authorizer<UserProfile>
public class CorsAuthorizer extends Object implements Authorizer<UserProfile>
Define how the CORS requests are authorized.- Since:
- 1.9.2
- Author:
- Jerome Leleu
-
-
Constructor Summary
Constructors Constructor Description CorsAuthorizer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
getAllowCredentials()
String
getAllowHeaders()
Set<HttpConstants.HTTP_METHOD>
getAllowMethods()
String
getAllowOrigin()
String
getExposeHeaders()
int
getMaxAge()
boolean
isAuthorized(WebContext context, List<UserProfile> profiles)
Checks if the user profiles and / or the current web context are authorized.void
setAllowCredentials(Boolean allowCredentials)
void
setAllowHeaders(String allowHeaders)
void
setAllowMethods(Set<HttpConstants.HTTP_METHOD> allowMethods)
void
setAllowOrigin(String allowOrigin)
void
setExposeHeaders(String exposeHeaders)
void
setMaxAge(int maxAge)
String
toString()
-
-
-
Method Detail
-
isAuthorized
public boolean isAuthorized(WebContext context, List<UserProfile> profiles)
Description copied from interface:Authorizer
Checks if the user profiles and / or the current web context are authorized.- Specified by:
isAuthorized
in interfaceAuthorizer<UserProfile>
- Parameters:
context
- the web contextprofiles
- the user profiles- Returns:
- if the access is authorized
-
getAllowOrigin
public String getAllowOrigin()
-
setAllowOrigin
public void setAllowOrigin(String allowOrigin)
-
getExposeHeaders
public String getExposeHeaders()
-
setExposeHeaders
public void setExposeHeaders(String exposeHeaders)
-
getMaxAge
public int getMaxAge()
-
setMaxAge
public void setMaxAge(int maxAge)
-
getAllowCredentials
public Boolean getAllowCredentials()
-
setAllowCredentials
public void setAllowCredentials(Boolean allowCredentials)
-
getAllowMethods
public Set<HttpConstants.HTTP_METHOD> getAllowMethods()
-
setAllowMethods
public void setAllowMethods(Set<HttpConstants.HTTP_METHOD> allowMethods)
-
getAllowHeaders
public String getAllowHeaders()
-
setAllowHeaders
public void setAllowHeaders(String allowHeaders)
-
-