sqrl.response module

class sqrl.response.SQRLHttpResponse(nut, data, *args, **kwargs)[source]

Bases: django.http.response.HttpResponse

Custom HTTPResponse class used to return SQRL-formatted response.

The response is automatically signed, normalized and encoded as per SQRL specification.

This view also adds a couple of DEBUG logs for easier SQRL debugging and also returns all SQRL data back as X-SQRL-* headers.

Parameters:
  • nut (SQRLNut) – Nut which will be used to sign the response data.
  • data (OrderedDict) – Data to be returned back to the user.
sign_response(nut, data)[source]

When nut is present, this method signs the data by adding mac key.

For signing crypto.HMAC.sign_data() is used.