use of org.gluu.oxauth.util.RedirectUri in project oxAuth by GluuFederation.
the class ErrorHandlerService method handleRemoteError.
private void handleRemoteError(String facesMessageId, IErrorType errorType, String hint) {
String redirectUri = cookieService.getRpOriginIdCookie();
if (StringHelper.isEmpty(redirectUri)) {
Log.error("Failed to get redirect_uri from cookie");
handleLocalError(facesMessageId);
return;
}
RedirectUri redirectUriResponse = new RedirectUri(redirectUri, null, null);
redirectUriResponse.parseQueryString(errorResponseFactory.getErrorAsQueryString(errorType, null));
if (StringHelper.isNotEmpty(hint)) {
redirectUriResponse.addResponseParameter("hint", "Create authorization request to start new authentication session.");
}
facesService.redirectToExternalURL(redirectUriResponse.toString());
}
use of org.gluu.oxauth.util.RedirectUri in project oxAuth by GluuFederation.
the class CIBAAuthorizeAction method getAuthRequest.
public String getAuthRequest() {
String authorizationEndpoint = appConfiguration.getAuthorizationEndpoint();
String clientId = appConfiguration.getBackchannelClientId();
String redirectUri = appConfiguration.getBackchannelRedirectUri();
String responseType = "token id_token";
String scope = "openid";
String state = UUID.randomUUID().toString();
String nonce = UUID.randomUUID().toString();
RedirectUri authRequest = new RedirectUri(authorizationEndpoint);
authRequest.addResponseParameter(CLIENT_ID, clientId);
authRequest.addResponseParameter(REDIRECT_URI, redirectUri);
authRequest.addResponseParameter(RESPONSE_TYPE, responseType);
authRequest.addResponseParameter(SCOPE, scope);
authRequest.addResponseParameter(STATE, state);
authRequest.addResponseParameter(NONCE, nonce);
return authRequest.toString();
}
Aggregations