class LoginAuthenticator {

    public LoginProcess getLoginProcess(LoginConfiguration loginConfiguration) throws AuthException, AuthLoginException,
            SSOException, RestAuthException {

        verifyAuthenticationRealm(loginConfiguration.getHttpRequest());

        SSOToken ssoToken = coreServicesWrapper.getExistingValidSSOToken(new SessionID(loginConfiguration.getSSOTokenId()));
        if (noMoreAuthenticationRequired(ssoToken, loginConfiguration)) {
            return new CompletedLoginProcess(this, loginConfiguration, coreServicesWrapper, ssoToken);
        }

        AuthContextLocalWrapper authContext = getAuthContext(loginConfiguration);

        LoginProcess loginProcess = new LoginProcess(this, loginConfiguration, authContext, coreServicesWrapper);
        if (coreServicesWrapper.isNewRequest(authContext)) {
            startLoginProcess(loginProcess);
        }

        return loginProcess;
    }

    @Inject public  LoginAuthenticator(CoreServicesWrapper coreServicesWrapper);

}