diff --git a/docs/simplesamlphp-sp-api.md b/docs/simplesamlphp-sp-api.md
index 03354ab87645bc8f93f1cbd356ae0b82a7866643..e5b722b05655863e660e8a5695e2072e97789ff7 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 4f90c32f8b54bf677442aa9973ca6aed4482a217..bda37fea1540616686534d6fcd54a876b32b3c33 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.