summaryrefslogtreecommitdiffstats
path: root/php/Attic/examples/sample-sp/login.php
diff options
context:
space:
mode:
authorChristophe Nowicki <cnowicki@easter-eggs.com>2004-08-18 15:03:56 +0000
committerChristophe Nowicki <cnowicki@easter-eggs.com>2004-08-18 15:03:56 +0000
commit131a818d244eea55a4e038c654c72ceee0a17526 (patch)
tree3a11a9fa8260bd3a1b0f1d46b15373fe4160f0c2 /php/Attic/examples/sample-sp/login.php
parent712ff1a9f7f68c8ade853f3ae031666a63120fa8 (diff)
Service Provider written in PHP (login is working and logout will work soon ;0)
Diffstat (limited to 'php/Attic/examples/sample-sp/login.php')
-rw-r--r--php/Attic/examples/sample-sp/login.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/php/Attic/examples/sample-sp/login.php b/php/Attic/examples/sample-sp/login.php
new file mode 100644
index 00000000..4b70c095
--- /dev/null
+++ b/php/Attic/examples/sample-sp/login.php
@@ -0,0 +1,58 @@
+<?php
+/*
+ *
+ * Service Provider Example -- Simple Sing On
+ *
+ * Copyright (C) 2004 Entr'ouvert
+ * http://lasso.entrouvert.org
+ *
+ * Authors: Christophe Nowicki <cnowicki@easter-eggs.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+ include "config.php.inc";
+
+ lasso_init();
+
+ $server_dump = file_get_contents($server_dump_filename);
+
+ $server = lasso_server_new_from_dump($server_dump);
+
+ $login = lasso_login_new($server);
+
+ lasso_login_init_authn_request($login);
+
+ $profile = lasso_cast_to_profile($login);
+
+ $node = lasso_profile_get_request($profile);
+
+ $lib_authn_request = lasso_cast_to_lib_authn_request($node);
+
+ // lasso_lib_authn_request_set_forceauthn($lib_authn_request, TRUE);
+ lasso_lib_authn_request_set_ispassive($lib_authn_request, FALSE);
+ lasso_lib_authn_request_set_nameidpolicy($lib_authn_request, lassoLibNameIDPolicyTypeFederated);
+ lasso_lib_authn_request_set_consent($lib_authn_request, lassoLibConsentObtained);
+
+ lasso_login_build_authn_request_msg($login, "https://idp1/metadata");
+
+
+ $url = lasso_profile_get_msg_url($profile);
+
+ header("Request-URI: $url");
+ header("Content-Location: $url");
+ header("Location: $url");
+ exit();
+?>