public URI createRequest() throws GuacamoleException {

        Saml2Settings samlSettings = confService.getSamlSettings();

        // Produce redirect for continuing the authentication process with
        // the SAML IdP
        try {
            Auth auth = new Auth(samlSettings, null, null);

            // Generate a unique ID to use for the relay state
            String identifier = IdentifierGenerator.generateIdentifier();

            // Create the request URL for the SAML IdP
            String requestUrl = auth.login(
                    identifier,
                    new AuthnRequestParams(false, false, true),
                    true);

            // Create a new authentication session to represent this attempt while
            // it is in progress, using the request ID that was just issued
            SAMLAuthenticationSession session = new SAMLAuthenticationSession(
                    auth.getLastRequestId(),
                    confService.getAuthenticationTimeout() * 60000L);

            // Save the session with the unique relay state ID
            sessionManager.defer(session, identifier);

            return new URI(requestUrl);
        }
        catch (IOException e) {
            throw new GuacamoleServerException("SAML authentication request "
                    + "could not be encoded: " + e.getMessage());
        }
        catch (URISyntaxException e) {
            throw new GuacamoleServerException("SAML IdP redirect could not "
                    + "be generated due to an error in the URI syntax: "
                    + e.getMessage());
        }
        catch (SettingsException e) {
            throw new GuacamoleServerException("Error while attempting to sign "
                    + "request using provided private key / certificate: "
                    + e.getMessage(), e);
        }

    }
Creates a new SAML request, beginning the overall authentication flow
that will ultimately result in an asserted user identity if the user is
successfully authenticated by the SAML IdP. The URI of the SSO endpoint
of the SAML IdP that the user must be redirected to for the
authentication process to continue is returned.

@return
    The URI of the SSO endpoint of the SAML IdP that the user must be
    redirected to.

@throws GuacamoleException
    If an error prevents the SAML request and redirect URI from being
    generated.
extensions/guacamole-auth-sso/modules/guacamole-auth-sso-saml/src/main/java/org/apache/guacamole/auth/saml/acs/SAMLService.java