def valid_credentials?(kind, *credentials)
      return :unsupported unless [:cas, :cas_proxy].include?(kind)

      ticket = ticket_for(kind, *credentials)
      ticket.present!

      return nil unless ticket.ok?

      Aker::User.new(ticket.username).tap do |u|
        u.extend Aker::Cas::UserExt

        u.cas_url = cas_url
        u.proxy_callback_url = proxy_callback_url
        u.proxy_retrieval_url = proxy_retrieval_url

        if ticket.pgt_iou
          ticket.retrieve_pgt!

          u.pgt = ticket.pgt
        end
      end
    end
def valid_credentials?(kind, *credentials)
      return :unsupported unless [:cas, :cas_proxy].include?(kind)

      ticket = ticket_for(kind, *credentials)
      ticket.present!

      return nil unless ticket.ok?

      Aker::User.new(ticket.username).tap do |u|
        u.extend Aker::Cas::UserExt

        u.cas_url = cas_url
        u.proxy_callback_url = proxy_callback_url
        u.proxy_retrieval_url = proxy_retrieval_url

        if ticket.pgt_iou
          ticket.retrieve_pgt!

          u.pgt = ticket.pgt
        end
      end
    end
Creates a new instance of this authority.  It reads parameters
 from the `:cas` parameters section of the given configuration.
 See {Aker::Cas::ConfigurationHelper} for information about the
 meanings of these parameters.

 Verifies the given credentials with the CAS server.  The `:cas`
 and `:cas_proxy` kinds are supported.  Both kinds require two
 credentials in the following order:

 * The ticket (either a service ticket or proxy ticket)
 * The service URL associated with the ticket

 The returned user will be extended with {Aker::Cas::CasUser}.

 If CAS proxying is enabled, then this method also retrieves the
 proxy-granting ticket for the user.

 @see http://www.jasig.org/cas/protocol
   CAS 2 protocol specification, section 2.5.4
 @return [Aker::User,:unsupported,nil] a user if the credentials
   are valid, `:unsupported` if the kind is anything but `:cas`
   or `:cas_proxy`, and nil otherwise