djangosaml2idp icon indicating copy to clipboard operation
djangosaml2idp copied to clipboard

Multiple sp same entityid solution

Open lgarvey opened this issue 3 years ago • 1 comments

This is a minimal change required to provide at least the possibility of supporting multiple SP entries with the same entity id.

It's required specifically to support multiple integrations with AWS services which all use th same entity_id, but it's not possible (or logical) to create multiple ServiceProvider instances with the same entity-id. So the solution is to add an extra field in an overridden ServiceProvider instance e.g. real_entity_id which takes precedence if provided:

def get_entity_id(self):
    return self.real_entity_id or self.entity_id

The entity_id field can then be used as a lookup/alias field, e.g:

/idp/sso/init?sp=aws-quicksight /idp/sso/init?sp=aws-appstream

For each ServiceProvider instance the entity_id would hold the alias, e.g aws-quicksight or aws-appstream whilst the real_entity_id fields would be set to 'urn:amazon:webservices'

lgarvey avatar Mar 11 '21 15:03 lgarvey

Codecov Report

Merging #124 (51bd923) into master (0b43257) will increase coverage by 0.17%. The diff coverage is 97.87%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #124      +/-   ##
==========================================
+ Coverage   93.10%   93.28%   +0.17%     
==========================================
  Files          10       11       +1     
  Lines         682      715      +33     
==========================================
+ Hits          635      667      +32     
- Misses         47       48       +1     
Impacted Files Coverage Δ
djangosaml2idp/views.py 87.06% <87.50%> (-0.27%) :arrow_down:
djangosaml2idp/admin.py 100.00% <100.00%> (ø)
djangosaml2idp/forms.py 91.66% <100.00%> (ø)
djangosaml2idp/idp.py 100.00% <100.00%> (ø)
djangosaml2idp/models.py 94.85% <100.00%> (+0.55%) :arrow_up:
djangosaml2idp/settings.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0b43257...51bd923. Read the comment docs.

codecov-io avatar Mar 11 '21 17:03 codecov-io