public interface JwtTokenService
Modifier and Type | Method and Description |
---|---|
String |
createToken(javax.servlet.http.HttpServletRequest request,
Map<String,Object> claims)
Returns a signed JWT (JWS) token for an
HttpServletRequest that has been authenticated containing an
HttpSession that can be retrieved via CmsSessionContext.getContext(HttpSession) . |
AccessToken |
getAccessToken(String jws) |
String createToken(javax.servlet.http.HttpServletRequest request, Map<String,Object> claims)
Returns a signed JWT (JWS) token for an HttpServletRequest
that has been authenticated containing an
HttpSession
that can be retrieved via CmsSessionContext.getContext(HttpSession)
.
If the request has not already been authenticated or does not have its HttpSession
attached to the CmsSessionContext
,
an IllegalStateException
is thrown
request
- the HttpServletRequest which must have an http session that has been authenticated alreadyclaims
- the claims to add to the token, for example which branch to render, if no extra claims, use empty map.
The Objects need to be serializable to jsonIllegalStateException
- if the http request does not yet have an authenticated HttpSession
or does not yet have it attached to the CmsSessionContext
via CmsContextService.attachSessionContext(String, HttpSession)
AccessToken getAccessToken(String jws) throws InvalidTokenException
jws
- the signed JWT tokenAccessToken
objectInvalidTokenException
- in case the JWT token is not bound to a valid CmsSessionContext
(any more)TokenException
- in case the jwt service is not initialized or some unexpected exception happened not being
catched and thrown as a InvalidTokenExceptionCopyright © 2008–2020 Hippo B.V. (http://www.onehippo.com). All rights reserved.