Search in sources :

Example 6 with RedirectUri

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());
}
Also used : RedirectUri(org.gluu.oxauth.util.RedirectUri)

Example 7 with RedirectUri

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();
}
Also used : RedirectUri(org.gluu.oxauth.util.RedirectUri)

Aggregations

RedirectUri (org.gluu.oxauth.util.RedirectUri)7 WebApplicationException (javax.ws.rs.WebApplicationException)2 IOException (java.io.IOException)1 ResponseBuilder (javax.ws.rs.core.Response.ResponseBuilder)1 FirebaseCloudMessagingClient (org.gluu.oxauth.client.ciba.fcm.FirebaseCloudMessagingClient)1 FirebaseCloudMessagingRequest (org.gluu.oxauth.client.ciba.fcm.FirebaseCloudMessagingRequest)1 FirebaseCloudMessagingResponse (org.gluu.oxauth.client.ciba.fcm.FirebaseCloudMessagingResponse)1 OAuth2AuditLog (org.gluu.oxauth.model.audit.OAuth2AuditLog)1 AuthorizeErrorResponseType (org.gluu.oxauth.model.authorize.AuthorizeErrorResponseType)1 PushErrorResponseType (org.gluu.oxauth.model.ciba.PushErrorResponseType)1 AcrChangedException (org.gluu.oxauth.model.exception.AcrChangedException)1 InvalidSessionStateException (org.gluu.oxauth.model.exception.InvalidSessionStateException)1 ClientAuthorization (org.gluu.oxauth.model.ldap.ClientAuthorization)1 Client (org.gluu.oxauth.model.registration.Client)1 JsonWebResponse (org.gluu.oxauth.model.token.JsonWebResponse)1 ExternalPostAuthnContext (org.gluu.oxauth.service.external.context.ExternalPostAuthnContext)1 ExternalUpdateTokenContext (org.gluu.oxauth.service.external.context.ExternalUpdateTokenContext)1 EntryPersistenceException (org.gluu.persist.exception.EntryPersistenceException)1