aiowamp.CRAuth

class aiowamp.CRAuth(secret)[source]

Auth method for challenge response authentication.

WAMP Challenge-Response (“WAMP-CRA”) authentication is a simple, secure authentication mechanism using a shared secret. The client and the server share a secret. The secret never travels the wire, hence WAMP-CRA can be used via non-TLS connections. The actual pre-sharing of the secret is outside the scope of the authentication mechanism.

Parameters:secret (str) –

Initialise the auth method.

Parameters:secret (str) – Secret to use.
__init__(secret)[source]

Initialise the auth method.

Parameters:secret (str) – Secret to use.
Return type:None

Methods

__init__(secret) Initialise the auth method.
authenticate(challenge) Generate an authenticate message for the challenge.
check_welcome(welcome) Check the welcome message sent by the router.
pbkdf2_hmac(salt, key_len, iterations) Derive the token using the pdkdf2 scheme.

Attributes

auth_extra Additional auth extras that need to be passed along.
method_name
requires_auth_id Whether the auth method requires auth_id to be set.
secret Secret to use for authentication.
__init__(secret)[source]

Initialise the auth method.

Parameters:secret (str) – Secret to use.
Return type:None
__repr__()[source]

Return repr(self).

Return type:str
requires_auth_id

Whether the auth method requires auth_id to be set.

Return type:bool
auth_extra

Additional auth extras that need to be passed along.

None indicates that no extras need to be passed.

Return type:None
pbkdf2_hmac(salt, key_len, iterations)[source]

Derive the token using the pdkdf2 scheme.

Parameters:
  • salt (str) – Salt
  • key_len (int) – Key length
  • iterations (int) – Amount of iterations
Return type:

bytes

Returns:

Generated token bytes.

secret

Secret to use for authentication.

authenticate(challenge)[source]

Generate an authenticate message for the challenge.

Parameters:challenge (Challenge) – Challenge message to respond to.
Return type:Authenticate
Returns:Either an authenticate message to send to the router or an abort message to indicate that the attempt should be aborted.
Raises:Exception – When something goes wrong during authentication. Should be interpreted the same as an abort message.