sqlmapproject/sqlmap · error · SqlmapSyntaxException

you specified the HTTP authentication type, but did not…

Error message

you specified the HTTP authentication type, but did not provide the credentials

What it means

_setHTTPAuthentication validates that --auth-type and --auth-cred (or --auth-file) are supplied together. When --auth-type is given but neither credentials nor an auth file accompany it, sqlmap cannot build an authenticator, so this SqlmapSyntaxException is raised — a paired-option completeness check that fires before any HTTP request is made.

Solutions

  1. Add credentials matching the chosen type, e.g. `--auth-type=basic --auth-cred="user:pass"`.
  2. For PKI authentication, provide `--auth-file=/path/to/key.pem` instead of credentials.
  3. If authentication is not actually needed, remove --auth-type from the command line.
  4. For Bearer tokens, pass the token as --auth-cred, e.g. `--auth-type=bearer --auth-cred="<token>"`.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at lib/core/option.py:1484 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/7a0c87d61bc7d850. Report an issue: GitHub.

Appendix: source

Thrown at lib/core/option.py:1484

def _setHTTPAuthentication():
    """
    Check and set the HTTP(s) authentication method (Basic, Digest, Bearer, NTLM, Negotiate or PKI),
    username and password for first three methods, or PEM private key file for
    PKI authentication
    """

    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):

View on GitHub (pinned to 0a35b20e39)