code: protected Credential getCredential(HttpServletRequest req) {
      Credential cred = (Credential) req.getAttribute(AUTH_CREDENTIAL);
      return cred;
    }
docs: Fetch a credential associated with this request.
  
  @param req Request object to use as context for fetching the credential.
  @return Credential object for this request and user.
  
  @since 1.5