Skip to content

Commit

Permalink
feat: Added hostname as an env.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shrey Bana committed Dec 4, 2024
1 parent 6c46749 commit 7e48ab7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crates/superposition/src/auth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ pub fn init_auth() -> saml2::SAMLAuthProvider {
.unwrap();
let md_xml = fs::read_to_string("saml-idp-meta.xml").unwrap();
let md: EntityDescriptor = samael::metadata::de::from_str(md_xml.as_str()).unwrap();
let host = env::var("HOSTNAME")
.ok()
.expect("Env 'HOSTNAME' not declared.");
let sp = ServiceProviderBuilder::default()
.entity_id("test-saml-sso-app".to_string())
.idp_metadata(md)
Expand All @@ -29,8 +32,8 @@ pub fn init_auth() -> saml2::SAMLAuthProvider {
sur_name: Some("Doe".to_string()),
..ContactPerson::default()
})
.acs_url("https://test.devspaceworks.net/saml/acs".to_string())
.slo_url("/saml/slo".to_string())
.acs_url(format!("https://{}/saml/acs", host))
.slo_url(format!("https://{}/saml/metadata", host))
.build()
.unwrap();
saml2::SAMLAuthProvider {
Expand Down

0 comments on commit 7e48ab7

Please sign in to comment.