pub fn generate_login_form(response: ResponseElements, relay_state: String) -> String {
    let mut context = tera::Context::new();

    context.insert("form_action", &response.destination);
    let response_data = response.base64_encoded_response();
    let saml_response = from_utf8(&response_data).unwrap().to_string();
    context.insert("SAMLResponse", &saml_response);
    context.insert("RelayState", &relay_state);

    let template = String::from(
        r#"<p>{{SAMLResponse | safe}}</p>
<form method="post" action="{{form_action | safe}}">
    <input type="hidden" name="SAMLResponse" value="{{SAMLResponse | safe}}" />
    <input type="hidden" name="RelayState" value="{{RelayState}}" />
    <h1>Fancy example login form</h1>
    <p>Username: <input type='text' name='username' /></p>
    <p>Password: <input type='password' name='password' /></p>
    <p><input type="submit" value="Submit" /></p>
</form>"#,
    );

    tera::Tera::one_off(&template, &context, true)
        .unwrap_or_else(|_| String::from("Couldn't generate login form"))
}
/// Generate a fake login form for the user to interact with
///
/// TODO: These responses have to be signed
Generate a fake login form for the user to interact with
TODO: These responses have to be signed
Generate a fake login form for the user to interact with TODO : These responses have to be signed
pub fn generate_login_form(response: ResponseElements, relay_state: String) -> String {
    let mut context = tera::Context::new();
    context.insert("form_action", &response.destination);
    let response_data = response.base64_encoded_response();
    let saml_response = from_utf8(&response_data).unwrap().to_string();
    context.insert("SAMLResponse", &saml_response);
    context.insert("RelayState", &relay_state);
    let template = String::from(
        r#"<p>{{SAMLResponse | safe}}</p>
<form method="post" action="{{form_action | safe}}">
    <input type="hidden" name="SAMLResponse" value="{{SAMLResponse | safe}}" />
    <input type="hidden" name="RelayState" value="{{RelayState}}" />
    <h1>Fancy example login form</h1>
    <p>Username: <input type='text' name='username' /></p>
    <p>Password: <input type='password' name='password' /></p>
    <p><input type="submit" value="Submit" /></p>
</form>"#,
    );
    tera::Tera::one_off(&template, &context, true)
        .unwrap_or_else(|_| String::from("Couldn't generate login form"))
}
pub fn generate_login_form ( response : ResponseElements , relay_state : String ) -> String { let mut context = tera :: Context :: new ( ) ; context . insert ( " " , & response . destination ) ; let response_data = response . base64_encoded_response ( ) ; let saml_response = from_utf8 ( & response_data ) . unwrap ( ) . to_string ( ) ; context . insert ( " " , & saml_response ) ; context . insert ( " " , & relay_state ) ; let template = String :: from ( r#"<p>{{SAMLResponse | safe}}</p>
<form method="post" action="{{form_action | safe}}">
    <input type="hidden" name="SAMLResponse" value="{{SAMLResponse | safe}}" />
    <input type="hidden" name="RelayState" value="{{RelayState}}" />
    <h1>Fancy example login form</h1>
    <p>Username: <input type='text' name='username' /></p>
    <p>Password: <input type='password' name='password' /></p>
    <p><input type="submit" value="Submit" /></p>
</form>"# , ) ; tera :: Tera :: one_off ( & template , & context , true ) . unwrap_or_else ( | _ | String :: from ( " " ) ) }
Generate a fake login form for the user to interact with
TODO: These responses have to be signed
Generate a fake login form for the user to interact with TODO : These responses have to be signed
response
ResponseElements
relay_state
String
response
ResponseElements
relay_state
String