Class ResponseTypeHandlerUtil
- java.lang.Object
-
- org.wso2.carbon.identity.oauth2.authz.handlers.util.ResponseTypeHandlerUtil
-
public class ResponseTypeHandlerUtil extends Object
ResponseTypeHandlerUtil contains all the common methods in tokenResponseTypeHandler and IDTokenResponseTypeHandler.
-
-
Field Summary
Fields Modifier and Type Field Description static int
SECOND_TO_MILLISECONDS_FACTOR
-
Constructor Summary
Constructors Constructor Description ResponseTypeHandlerUtil()
-
Method Summary
-
-
-
Field Detail
-
SECOND_TO_MILLISECONDS_FACTOR
public static final int SECOND_TO_MILLISECONDS_FACTOR
- See Also:
- Constant Field Values
-
-
Method Detail
-
triggerPreListeners
public static void triggerPreListeners(OAuthAuthzReqMessageContext oauthAuthzMsgCtx)
-
triggerPostListeners
public static void triggerPostListeners(OAuthAuthzReqMessageContext oauthAuthzMsgCtx, AccessTokenDO tokenDO, OAuth2AuthorizeRespDTO respDTO)
-
generateAccessToken
public static AccessTokenDO generateAccessToken(OAuthAuthzReqMessageContext oauthAuthzMsgCtx, boolean cacheEnabled) throws IdentityOAuth2Exception
Generates access token for the issuer type registered in the service provider app.- Parameters:
oauthAuthzMsgCtx
-cacheEnabled
-- Returns:
- Throws:
IdentityOAuth2Exception
-
generateAccessToken
public static AccessTokenDO generateAccessToken(OAuthAuthzReqMessageContext oauthAuthzMsgCtx, boolean cacheEnabled, OauthTokenIssuer oauthIssuerImpl) throws IdentityOAuth2Exception
Generates access token for the given oauth issuer.- Parameters:
oauthAuthzMsgCtx
-cacheEnabled
-oauthIssuerImpl
-- Returns:
- Throws:
IdentityOAuth2Exception
-
generateAuthorizationCode
public static AuthzCodeDO generateAuthorizationCode(OAuthAuthzReqMessageContext oauthAuthzMsgCtx, boolean cacheEnabled) throws IdentityOAuth2Exception
- Throws:
IdentityOAuth2Exception
-
generateAuthorizationCode
public static AuthzCodeDO generateAuthorizationCode(OAuthAuthzReqMessageContext oauthAuthzMsgCtx, boolean cacheEnabled, OauthTokenIssuer oauthIssuerImpl) throws IdentityOAuth2Exception
- Throws:
IdentityOAuth2Exception
-
buildAuthorizationCodeResponseDTO
public static OAuth2AuthorizeRespDTO buildAuthorizationCodeResponseDTO(OAuth2AuthorizeRespDTO respDTO, AuthzCodeDO authzCodeDO) throws IdentityOAuth2Exception
- Throws:
IdentityOAuth2Exception
-
buildAccessTokenResponseDTO
public static OAuth2AuthorizeRespDTO buildAccessTokenResponseDTO(OAuth2AuthorizeRespDTO respDTO, AccessTokenDO accessTokenDO)
-
buildIDTokenResponseDTO
public static OAuth2AuthorizeRespDTO buildIDTokenResponseDTO(OAuth2AuthorizeRespDTO respDTO, AccessTokenDO accessTokenDO, OAuthAuthzReqMessageContext oauthAuthzMsgCtx) throws IdentityOAuth2Exception
This method is used to set the id_token value in respDTO. When creating the id_token, an access token is issued and through that access token user attributes are called. This access token details are not necessary for respDTO when issuing the id_token. So a new OAuth2AuthorizeRespDTO object is created and set all the relevant details that are needed in DefaultIDTokenBuilder class. After the id_token is issued, set the id_token value to respDTO object and return.- Parameters:
respDTO
-accessTokenDO
-oauthAuthzMsgCtx
-- Returns:
- OAuth2AuthorizeRespDTO object with id_token details.
- Throws:
IdentityOAuth2Exception
-
-