diff --git a/docs/simplesamlphp-sp-api.txt b/docs/simplesamlphp-sp-api.txt index 07c5a35c364913e0efa79e19f3262fc0239c00c5..7ccb2ae53e261078ed91e181305841441b5a729b 100644 --- a/docs/simplesamlphp-sp-api.txt +++ b/docs/simplesamlphp-sp-api.txt @@ -195,6 +195,23 @@ The attributes will be returned as an associative array with the name of the att print('Hello, ' . htmlspecialchars($name)); +`getAuthData` +--------------- + + mixed getAuthData(string $name) + +Retrieve the specified authentication data for the current session. +NULL is returned if the user isn't authenticated. + +The available authentication data depends on the module used for authentication. +See the [`saml:SP`](./saml:sp) reference for information about available SAML authentication data. + +### Example + + $idp = $auth->getAuthData('saml:sp:IdP'); + print(You are logged in from: ' . htmlspecialchars($idp)); + + `getLoginURL` ------------- diff --git a/modules/saml/docs/sp.txt b/modules/saml/docs/sp.txt index 9c7bc94f2fb113f78dcc8ff0dc4bc4c0c3fd16c1..f3c94092c371b6805a2ffe2061e5553cb8985ea7 100644 --- a/modules/saml/docs/sp.txt +++ b/modules/saml/docs/sp.txt @@ -42,6 +42,23 @@ All these parameters override the equivalent option from the configuration. : *Note*: SAML 2 specific. +Authentication data +------------------- + +Some SAML-specific attributes are available to the application after authentication. +To retrieve these attributes, the application can use the `getAuthData()`-function from the [SP API](./simplesamlphp-sp-api). +The following attributes are available: + +`saml:sp:IdP` +: The entityID of the IdP the user is authenticated against. + +`saml:sp:NameID` +: The NameID the user was issued by the IdP. + This is an associative array with the various fields from the NameID. + +`saml:sp:SessionIndex` +: The SessionIndex we received from the IdP. + Examples --------