Currently the Django session model doesn't have an user ID field:
class AbstractBaseSession(models.Model):
session_key = models.CharField(_('session key'), max_length=40, primary_key=True)
session_data = models.TextField(_('session data'))
expire_date = models.DateTimeField(_('expire date'), db_index=True)
This is impossible for us to implement "back-channel logout" because every service provider would have different session ids. To make this work, I will need to add an user identification field to the model, eg. username, so that the IdP can issue log out signal to all service providers to log the user out by using the username
class AbstractBaseSession(models.Model):
session_key = models.CharField(_('session key'), max_length=40, primary_key=True)
session_data = models.TextField(_('session data'))
expire_date = models.DateTimeField(_('expire date'), db_index=True)
username = models.CharField(...)
I am not 200% sure if this will have any security implications? Thought I'd post here to check with the experts.