def apply(params)
      case mode.to_sym
      when :basic_auth
        apply_basic_auth(params)
      when :request_body
        apply_params_auth(params)
      else
        raise NotImplementedError
      end
    end
def apply(params)
      case mode.to_sym
      when :basic_auth
        apply_basic_auth(params)
      when :request_body
        apply_params_auth(params)
      else
        raise NotImplementedError
      end
    end
Apply the request credentials used to authenticate to the Authorization Server

 Depending on configuration, this might be as request params or as an
 Authorization header.

 User-provided params and header take precedence.

 @param [Hash] params a Hash of params for the token endpoint
 @return [Hash] params amended with appropriate authentication details