sqlmapproject/sqlmap · error · SqlmapSyntaxException

you specified the HTTP authentication credentials, but did…

Error message

you specified the HTTP authentication credentials, but did not provide the type (e.g. --auth-type="basic")

What it means

The mirror guard of the pairing check: when --auth-cred is provided but --auth-type is absent (and no --auth-file implies PKI), sqlmap cannot know which authentication scheme to construct, so _setHTTPAuthentication raises this SqlmapSyntaxException suggesting --auth-type explicitly.

Solutions

  1. Add `--auth-type=` with one of: basic, digest, bearer, ntlm, negotiate or pki.
  2. Match the type to what the target requires (check the WWW-Authenticate header of a 401 response).
  3. Example: `--auth-type=digest --auth-cred="user:pass"`.
  4. If credentials were passed by mistake, remove --auth-cred.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/core/option.py:1489 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of sqlmapproject/sqlmap@0a35b20e39 (2026-08-26). Data as JSON: /api/errors/fb4d6b2233010524. Report an issue: GitHub.

Appendix: source

Thrown at lib/core/option.py:1489

    """

    global authHandler

    if not conf.authType and not conf.authCred and not conf.authFile:
        return

    if conf.authFile and not conf.authType:
        conf.authType = AUTH_TYPE.PKI

    elif conf.authType and not conf.authCred and not conf.authFile:
        errMsg = "you specified the HTTP authentication type, but "
        errMsg += "did not provide the credentials"
        raise SqlmapSyntaxException(errMsg)

    elif not conf.authType and conf.authCred:
        errMsg = "you specified the HTTP authentication credentials, "
        errMsg += "but did not provide the type (e.g. --auth-type=\"basic\")"
        raise SqlmapSyntaxException(errMsg)

    elif (conf.authType or "").lower() not in (AUTH_TYPE.BASIC, AUTH_TYPE.DIGEST, AUTH_TYPE.BEARER, AUTH_TYPE.NTLM, AUTH_TYPE.NEGOTIATE, AUTH_TYPE.PKI):
        errMsg = "HTTP authentication type value must be "
        errMsg += "Basic, Digest, Bearer, NTLM, Negotiate or PKI"
        raise SqlmapSyntaxException(errMsg)

    if not conf.authFile:
        debugMsg = "setting the HTTP authentication type and credentials"
        logger.debug(debugMsg)

        authType = conf.authType.lower()

        if authType in (AUTH_TYPE.BASIC, AUTH_TYPE.DIGEST):
            regExp = "^(.*?):(.*?)$"
            errMsg = "HTTP %s authentication credentials " % authType
            errMsg += "value must be in format 'username:password'"
        elif authType == AUTH_TYPE.BEARER:
            conf.httpHeaders.append((HTTP_HEADER.AUTHORIZATION, "Bearer %s" % conf.authCred.strip()))

View on GitHub (pinned to 0a35b20e39)