imsweb / django-saml-sp

A Django application for running one or more SAML service providers (SP)
BSD 3-Clause "New" or "Revised" License
15 stars 10 forks source link

Replace default value for authn_context #21

Closed merit-finns closed 1 year ago

merit-finns commented 1 year ago

I was recently trying to upgrade from 0.4.0 to 0.5.0 but got a migration error from authn_context field in the idp model. The new field is JSON and the default value is True, which is not supported in Oracle.

After reading through #11 and some of python-saml, I believe setting this value to ['urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport'] instead of 'True' results in the same requested_authn_context_str, without breaking the migrations for Oracle users.

dcwatson commented 1 year ago

I think I'm inclined to just set authn_context to null=True and default=None, then put self.authn_context if self.authn_context is not None else True in sp_settings. Would that work for you?

Edit: I suppose it probably wouldn't help with the 0012 migration being broken. I think your solution is reasonable, I'll merge it.

merit-finns commented 1 year ago

Thanks!