This document is for py-amqp's development version, which can be significantly different from previous releases. Get the stable docs here: 2.2.


SASL mechanisms for AMQP authentication.

class amqp.sasl.AMQPLAIN(username, password)[source]

AMQPLAIN SASL authentication mechanism.

This is a non-standard mechanism used by AMQP servers.

mechanism = 'AMQPLAIN'
class amqp.sasl.EXTERNAL[source]

EXTERNAL SASL mechanism.

Enables external authentication, i.e. not handled through this protocol. Only passes ‘EXTERNAL’ as authentication mechanism, but no further authentication data.

mechanism = 'EXTERNAL'

alias of amqp.sasl.FakeGSSAPI

class amqp.sasl.PLAIN(username, password)[source]

PLAIN SASL authentication mechanism.

See for details

mechanism = 'PLAIN'
class amqp.sasl.RAW(mechanism, response)[source]

A generic custom SASL mechanism.

This mechanism takes a mechanism name and response to send to the server, so can be used for simple custom authentication schemes.

mechanism = None
class amqp.sasl.SASL[source]

The base class for all amqp SASL authentication mechanisms.

You should sub-class this if you’re implementing your own authentication.


Return a bytes containing the SASL mechanism name.


Return the first response to a SASL challenge as a bytes object.