mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUACAMOLE-1364: Extract common SSO resource for IdP redirect.
This commit is contained in:
@@ -95,16 +95,20 @@ public class AuthenticationProviderService implements SSOAuthenticationProviderS
|
||||
|
||||
// Redirect to SAML IdP if no SAML identity is associated with the
|
||||
// Guacamole authentication request
|
||||
URI authUri = saml.createRequest();
|
||||
throw new GuacamoleInvalidCredentialsException("Redirecting to SAML IdP.",
|
||||
new CredentialsInfo(Arrays.asList(new Field[] {
|
||||
new RedirectField(AUTH_SESSION_QUERY_PARAM, authUri,
|
||||
new RedirectField(AUTH_SESSION_QUERY_PARAM, getLoginURI(),
|
||||
new TranslatableMessage("LOGIN.INFO_IDP_REDIRECT_PENDING"))
|
||||
}))
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public URI getLoginURI() throws GuacamoleException {
|
||||
return saml.createRequest();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void shutdown() {
|
||||
sessionManager.shutdown();
|
||||
|
@@ -39,7 +39,7 @@ import org.slf4j.LoggerFactory;
|
||||
* endpoint. SAML identity providers will issue an HTTP POST to this endpoint
|
||||
* asserting the user's identity when the user has successfully authenticated.
|
||||
*/
|
||||
public class AssertionConsumerServiceResource implements SSOResource {
|
||||
public class AssertionConsumerServiceResource extends SSOResource {
|
||||
|
||||
/**
|
||||
* Logger for this class.
|
||||
@@ -64,11 +64,6 @@ public class AssertionConsumerServiceResource implements SSOResource {
|
||||
@Inject
|
||||
private SAMLService saml;
|
||||
|
||||
@Override
|
||||
public Response redirectToIdentityProvider() throws GuacamoleException {
|
||||
return Response.seeOther(saml.createRequest()).build();
|
||||
}
|
||||
|
||||
/**
|
||||
* Processes the SAML response submitted by the SAML IdP via an HTTP POST.
|
||||
* If SSO has been successful, the user is redirected back to Guacamole to
|
||||
|
Reference in New Issue
Block a user