use of org.wso2.carbon.identity.oauth.endpoint.util.EndpointUtil.getOAuth2Service in project identity-inbound-auth-oauth by wso2-extensions.
the class OAuth2AuthzEndpoint method handleFailedAuthentication.
private Response handleFailedAuthentication(OAuthMessage oAuthMessage, OAuth2Parameters oauth2Params, AuthenticationResult authnResult) throws URISyntaxException {
OAuthErrorDTO oAuthErrorDTO = EndpointUtil.getOAuth2Service().handleAuthenticationFailure(oauth2Params);
OAuthProblemException oauthException = buildOAuthProblemException(authnResult, oAuthErrorDTO);
return handleFailedState(oAuthMessage, oauth2Params, oauthException);
}
use of org.wso2.carbon.identity.oauth.endpoint.util.EndpointUtil.getOAuth2Service in project identity-inbound-auth-oauth by wso2-extensions.
the class OAuth2AuthzEndpoint method handleDeniedConsent.
private Response handleDeniedConsent(OAuthMessage oAuthMessage) throws OAuthSystemException, URISyntaxException {
OAuth2Parameters oauth2Params = getOauth2Params(oAuthMessage);
OpenIDConnectUserRPStore.getInstance().putUserRPToStore(getLoggedInUser(oAuthMessage), getOauth2Params(oAuthMessage).getApplicationName(), false, oauth2Params.getClientId());
OAuthErrorDTO oAuthErrorDTO = EndpointUtil.getOAuth2Service().handleUserConsentDenial(oauth2Params);
OAuthProblemException consentDenialException = buildConsentDenialException(oAuthErrorDTO);
String denyResponse = EndpointUtil.getErrorRedirectURL(oAuthMessage.getRequest(), consentDenialException, oauth2Params);
if (StringUtils.equals(oauth2Params.getResponseMode(), RESPONSE_MODE_FORM_POST)) {
return handleFailedState(oAuthMessage, oauth2Params, consentDenialException);
}
return Response.status(HttpServletResponse.SC_FOUND).location(new URI(denyResponse)).build();
}
Aggregations