def authenticate(username, password)
      login_result = do_login(username, password)
      return unless login_result

      if st = extract_service_ticket_if_successful(login_result)
        configuration.composite_authority.valid_credentials?(:cas, st, CLI_SERVICE)
      end
    end
def authenticate(username, password)
      login_result = do_login(username, password)
      return unless login_result

      if st = extract_service_ticket_if_successful(login_result)
        configuration.composite_authority.valid_credentials?(:cas, st, CLI_SERVICE)
      end
    end
Creates a new instance.

 @param [Aker::Configuration] configuration the Aker
   configuration to use. This configuration should have the :cas
   authority (or an appropriate substitute) configured into its
   authority chain.
 @param [Hash] mechanize_options attribute values for the
   mechanize agent used to do the scraping. Use this, e.g., to
   specify the SSL CA to use.

 Attempts to verify the provided credentials. Verification is
 attempted through screen-scraping the login form provided by the
 CAS server configured in {#configuration}.

 @return [Aker::User,nil] the authenticated user, or nil if the
   credentials are invalid.