public interface AuthService
| Modifier and Type | Field and Description |
|---|---|
static String |
AUTH_HEADER_NAME |
| Modifier and Type | Method and Description |
|---|---|
void |
addAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.security.core.Authentication authentication)
Add the authentication on the response after performs other operations like persistence server side
|
default String |
createTokenForUser(TokenUser user,
String secret) |
Collection<String> |
extractUserAppRoles(Collection<String> roles) |
default TokenUser |
fromJSON(String userJSON) |
org.springframework.security.core.Authentication |
getAuthentication(javax.servlet.http.HttpServletRequest request) |
long |
getTokenTimeout() |
default TokenUser |
getTokenUser(org.springframework.security.core.Authentication authentication) |
default TokenUser |
parseUserFromToken(String token,
String secret) |
default String |
toJSON(TokenUser user) |
static final String AUTH_HEADER_NAME
org.springframework.security.core.Authentication getAuthentication(javax.servlet.http.HttpServletRequest request)
void addAuthentication(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response,
org.springframework.security.core.Authentication authentication)
request - the http requestresponse - the http responseauthentication - the authenticationCollection<String> extractUserAppRoles(Collection<String> roles)
roles - a collection of rolesdefault TokenUser getTokenUser(org.springframework.security.core.Authentication authentication)
authentication - the spring security Authenticationdefault TokenUser fromJSON(String userJSON)
userJSON - representation of the TokenUserdefault String toJSON(TokenUser user)
user - the TokenUser to be serializesdefault TokenUser parseUserFromToken(String token, String secret)
token - the encoded tokensecret - secret phrase to decodedefault String createTokenForUser(TokenUser user, String secret)
user - the user to create token forsecret - the secret for signaturelong getTokenTimeout()
Copyright © 2018–2021 LF AI & Data Foundation. All rights reserved.