From 92bba43772a6898b9487b561fa6c8a6fe80b5bab Mon Sep 17 00:00:00 2001 From: Thijs Kinkhorst <thijs@kinkhorst.com> Date: Fri, 30 Oct 2020 09:14:24 +0000 Subject: [PATCH] Correct NameID api docs and add an example. --- docs/simplesamlphp-sp-api.md | 3 ++- modules/saml/docs/sp.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/simplesamlphp-sp-api.md b/docs/simplesamlphp-sp-api.md index 03354ab87..e5b722b05 100644 --- a/docs/simplesamlphp-sp-api.md +++ b/docs/simplesamlphp-sp-api.md @@ -226,7 +226,8 @@ See the [`saml:SP`](./saml:sp) reference for information about available SAML au ### Example $idp = $auth->getAuthData('saml:sp:IdP'); - print('You are logged in from: ' . htmlspecialchars($idp)); + $nameID = $auth->getAuthData('saml:sp:NameID')->getValue(); + printf('You are %s, logged in from %s', htmlspecialchars($nameID), htmlspecialchars($idp)); `getLoginURL` diff --git a/modules/saml/docs/sp.md b/modules/saml/docs/sp.md index 895bbadf4..7bca80808 100644 --- a/modules/saml/docs/sp.md +++ b/modules/saml/docs/sp.md @@ -94,7 +94,7 @@ The following attributes are available: `saml:sp:NameID` : The NameID the user was issued by the IdP. - This is an associative array with the various fields from the NameID. + This is a \SAML2\XML\saml\NameID object with the various fields from the NameID. `saml:sp:SessionIndex` : The SessionIndex we received from the IdP. -- GitLab