@classmethod
def from_json(cls, json_blob):
    """
        Given an authentication JSON blob, which should look like::

            {
                "auth": {
                    "passwordCredentials": {
                        "username": "user",
                        "password": "pass"
                    },
                    "tenantId": "111111"
                }
            }

        ``"tenantId"`` is interchanable with ``"tenantName"``, and is
        optional.

        :return: a class:`PasswordCredentials` object
        """
    tenant_id = json_blob['auth'].get('tenantName')
    if tenant_id is None:
        tenant_id = json_blob['auth'].get('tenantId')
    username = json_blob['auth'][cls.type_key]['username']
    password = json_blob['auth'][cls.type_key]['password']
    return cls(username=username, password=password, tenant_id=tenant_id)
