@Service public class IdentityServiceImpl extends Object implements IdentityService
| Modifier and Type | Field and Description |
|---|---|
static String |
IAM_ADMIN_DELETE_TOKENS |
static String |
IAM_ADMIN_ENDPOINT |
static String |
IAM_ADMIN_TOKENS |
static String |
IAM_BASE_SERVICE |
static String |
IAM_USER_ENDPOINT |
static String |
IAM_USER_SESSION_TOKEN |
static String |
IAM_USER_TOKENS |
static String |
IAM_USER_VALIDATE |
| Constructor and Description |
|---|
IdentityServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
org.springframework.web.client.RestTemplate |
createBasicAuthTemplate(String username,
String password) |
void |
deleteToken(String token)
HttpClientErrorException 400 Bad Request if token in not available
|
OAuthTokenDto |
generateLongLivedToken(String username,
String deviceId,
String deviceType)
generate/create a new long lived access token for this current logged in user
Request:
{
"tokenRequest": {
"deviceId": "firefox",
"deviceType": "browser",
"expirationTimestamp": "2017-01-04T14:36:17-0800", // or it can be a long value 1423861196185
"comments": "long term token"
}
}
|
OAuthTokenDto |
generateSessionToken(String username)
Create a session token valid for 24 hours for this current logged in user.
|
OAuthListTokenDto |
getAllTokens(String username)
List of all available token for this current logged in user
HttpClientErrorException 400 Bad Request if username not fond
|
OAuthValidateDto |
validateToken(String token)
if boolean authenticated = checkToken(HttpServletRequest httpRequest, HttpServletResponse httpResponse)
then in GenericFilterBean.doFilter continue --> FilterChain.doFilter(request, response);
httpServletResponse.setStatus(HttpServletResponse.SC_OK);
Response:
|
public static final String IAM_BASE_SERVICE
public static final String IAM_USER_ENDPOINT
public static final String IAM_ADMIN_ENDPOINT
public static final String IAM_USER_VALIDATE
public static final String IAM_USER_SESSION_TOKEN
public static final String IAM_USER_TOKENS
public static final String IAM_ADMIN_TOKENS
public static final String IAM_ADMIN_DELETE_TOKENS
public void deleteToken(String token)
deleteToken in interface IdentityServicetoken - public OAuthTokenDto generateLongLivedToken(String username, String deviceId, String deviceType) throws org.springframework.web.client.RestClientException
generateLongLivedToken in interface IdentityServiceorg.springframework.web.client.RestClientExceptionpublic OAuthTokenDto generateSessionToken(String username) throws org.springframework.web.client.RestClientException
generateSessionToken in interface IdentityServiceorg.springframework.web.client.RestClientExceptionpublic OAuthValidateDto validateToken(String token)
validateToken in interface IdentityServicepublic OAuthListTokenDto getAllTokens(String username) throws org.springframework.web.client.RestClientException
getAllTokens in interface IdentityServiceorg.springframework.web.client.RestClientExceptionCopyright © 2016. All rights reserved.