private String createErrorUri(final String message) {
        final URI uri = uriFactory.uiUri(ResourcePaths.buildServletPath(ResourcePaths.SIGN_IN_PATH));
        UriBuilder uriBuilder = UriBuilder.fromUri(uri);
        uriBuilder = UriBuilderUtil.addParam(uriBuilder, "error", message);
        final String uriStr = uriBuilder.build().toString();
        LOGGER.debug("Sending user to error screen with uri: {}", uriStr);
        return uriStr;
    }
This method attempts to get a token from the request headers and, if present, use that to login.
stroom-security/stroom-security-impl/src/main/java/stroom/security/impl/OpenIdManager.java