credentials

Credentials Classes

PlainCredentials

class pika.credentials.PlainCredentials(username, password, erase_on_connect=False)[source]

The PlainCredentials class returns the properly formatted username and password to the Connection. As of this version of Pika, only PlainCredentials are supported. To authenticate with Pika, simply create a credentials object passing in the username and password and pass that to the ConnectionParameters object.

If you do not pass in credentials to the ConnectionParameters object, it will create credentials for ‘guest’ with the password of ‘guest’.

If you pass True to erase_on_connect the credentials will not be stored in memory after the Connection attempt has been made.

PlainCredentials.erase_credentials()[source]

Called by Connection when it no longer needs the credentials

PlainCredentials.response_for(start)[source]

Validate that this type of authentication is supported

Parameters:start (spec.Connection.Start) – Connection.Start method
Return type:tuple(str|None, str|None)

ExternalCredentials

class pika.credentials.ExternalCredentials[source]

The ExternalCredentials class allows the connection to use EXTERNAL authentication, generally with a client SSL certificate.

ExternalCredentials.erase_credentials()[source]

Called by Connection when it no longer needs the credentials

ExternalCredentials.response_for(start)[source]

Validate that this type of authentication is supported

Parameters:start (spec.Connection.Start) – Connection.Start method
Return type:tuple(str or None, str or None)

Project Versions

Table Of Contents

Previous topic

connection

Next topic

data

This Page