Dynamically load the SSO IdP metadata at startup #279
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adjusts our SAML code a bit to dynamically load the IdP's metadata at startup vs. requiring us to pass it in. This also allows us to check that the IdP is reachable.
This data is not a secret (the metadata is always public), so we don't need to keep it in secrets. And storing the entire file seems like a waste, so this uses the URL. This change will make it easier to setup staging and production too.
One note about the way I'm doing this. This code intentionally re-uses a Promise, so I haven't forgotten the
await
in myfetch
call. It's too bad Samlify doesn't support this use case directly.I've put this in 0.5 since I missed code freeze for 0.4.