public class OpenIdConnectRESTHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
OpenIdConnectRESTHelper() |
| Modifier and Type | Method and Description |
|---|---|
static String |
buildLoginRequestURL(URL loginURL,
String clientId,
String state,
String redirectURI) |
protected static String |
getClientIdFromToken(JWTToken token) |
static byte[] |
getUserAvatar(URL avatarURL,
JWTToken token) |
static byte[] |
getUserAvatar(URL avatarURL,
String authorization) |
static boolean |
isAccessDeniedNotAuthorizedError(String jsonString) |
static boolean |
isInvalidBearerTokenError(String jsonString) |
static boolean |
isTokenNotActiveError(String jsonString) |
static boolean |
logout(URL logoutUrl,
JWTToken token) |
static boolean |
logout(URL logoutUrl,
String clientId,
JWTToken token) |
static String |
mapToQueryString(Map<String,List<String>> params) |
protected static boolean |
matchesErrorAndDescription(String jsonString,
String expectedError,
String exepectedErrorDescription) |
static JWTToken |
performQueryTokenWithPOST(URL tokenURL,
String authorization,
Map<String,List<String>> params) |
protected static HttpURLConnection |
performURLEncodedPOSTSendData(URL url,
Map<String,List<String>> params,
String authorization) |
static JWTToken |
queryClientToken(String clientId,
String clientSecret,
URL tokenURL) |
static JWTToken |
queryToken(String clientId,
URL tokenURL,
String code,
String scope,
String redirectURI) |
static JWTToken |
queryUMAToken(URL tokenUrl,
String authorizationToken,
String audience,
List<String> permissions) |
static JWTToken |
refreshToken(URL tokenURL,
JWTToken token) |
static JWTToken |
refreshToken(URL tokenURL,
String clientId,
JWTToken token) |
static JWTToken |
refreshToken(URL tokenURL,
String clientId,
String clientSecret,
JWTToken token) |
public static String buildLoginRequestURL(URL loginURL, String clientId, String state, String redirectURI) throws UnsupportedEncodingException
UnsupportedEncodingExceptionpublic static JWTToken queryClientToken(String clientId, String clientSecret, URL tokenURL) throws OpenIdConnectRESTHelperException
OpenIdConnectRESTHelperExceptionpublic static JWTToken queryToken(String clientId, URL tokenURL, String code, String scope, String redirectURI) throws Exception
Exceptionpublic static JWTToken performQueryTokenWithPOST(URL tokenURL, String authorization, Map<String,List<String>> params) throws OpenIdConnectRESTHelperException
OpenIdConnectRESTHelperExceptionprotected static HttpURLConnection performURLEncodedPOSTSendData(URL url, Map<String,List<String>> params, String authorization) throws IOException, ProtocolException, UnsupportedEncodingException
public static JWTToken queryUMAToken(URL tokenUrl, String authorizationToken, String audience, List<String> permissions) throws OpenIdConnectRESTHelperException
OpenIdConnectRESTHelperExceptionpublic static JWTToken refreshToken(URL tokenURL, JWTToken token) throws OpenIdConnectRESTHelperException
OpenIdConnectRESTHelperExceptionpublic static JWTToken refreshToken(URL tokenURL, String clientId, JWTToken token) throws OpenIdConnectRESTHelperException
OpenIdConnectRESTHelperExceptionpublic static JWTToken refreshToken(URL tokenURL, String clientId, String clientSecret, JWTToken token) throws OpenIdConnectRESTHelperException
OpenIdConnectRESTHelperExceptionpublic static boolean logout(URL logoutUrl, JWTToken token) throws IOException
IOExceptionpublic static boolean logout(URL logoutUrl, String clientId, JWTToken token) throws IOException
IOExceptionprotected static boolean matchesErrorAndDescription(String jsonString, String expectedError, String exepectedErrorDescription)
public static boolean isTokenNotActiveError(String jsonString)
public static boolean isInvalidBearerTokenError(String jsonString)
public static boolean isAccessDeniedNotAuthorizedError(String jsonString)
Copyright © 2021. All Rights Reserved.