Class RolesCookie
java.lang.Object
ch.tocco.nice2.web.core.api.servlet.AbstractNiceCookie
ch.tocco.nice2.web.core.api.servlet.JwtCookie<RolesCookie.DataHolder>
ch.tocco.nice2.web.core.api.servlet.RolesCookie
Implements the nice_roles cookie.
The content given to this class will be the content of the "roles" claim inside a JWT that has been signed with the given secret.
-
Nested Class Summary
-
Field Summary
Fields inherited from class ch.tocco.nice2.web.core.api.servlet.AbstractNiceCookie
addedToResponse, content, expires, sameSiteMode, secure
-
Constructor Summary
ConstructorDescriptionRolesCookie
(String roles, String secret, int timeToLive, String originDomain, String businessUnit) -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getDeletionString
(String host) Returns a plain string that can be used to direct the browser to delete this cookie.protected String
getName()
protected void
setClaims
(RolesCookie.DataHolder dataHolder, BiConsumer<String, Object> claimConsumer) Methods inherited from class ch.tocco.nice2.web.core.api.servlet.JwtCookie
generateJwt, getSpecificTokens
Methods inherited from class ch.tocco.nice2.web.core.api.servlet.AbstractNiceCookie
addToResponse, setExpires, verifyConfiguration
-
Field Details
-
NAME
- See Also:
-
HEADER_PATTERN
-
-
Constructor Details
-
RolesCookie
-
-
Method Details
-
getDeletionString
Returns a plain string that can be used to direct the browser to delete this cookie. -
getName
- Specified by:
getName
in classAbstractNiceCookie
-
setClaims
protected void setClaims(RolesCookie.DataHolder dataHolder, BiConsumer<String, Object> claimConsumer) - Specified by:
setClaims
in classJwtCookie<RolesCookie.DataHolder>
-