diff --git a/src/authentic2/saml/models.py b/src/authentic2/saml/models.py index dbd80a368..43d5e9f8d 100644 --- a/src/authentic2/saml/models.py +++ b/src/authentic2/saml/models.py @@ -335,7 +335,8 @@ class LibertyProvider(Service): def save(self, *args, **kwargs): '''Update the SHA1 hash of the entity_id when saving''' if self.protocol_conformance == 3: - self.entity_id_sha1 = hashlib.sha1(self.entity_id).hexdigest() + self.entity_id_sha1 = hashlib.sha1(self.entity_id.encode('ascii')) \ + .hexdigest() super(LibertyProvider, self).save(*args, **kwargs) def clean(self):