Authenticate User for Embedding with SAML Authentication
{ authenticateUserEmbedSAML }
Generates a Pyramid access authentication token for embedding using SAML authentication tokens
Method
Input Parameters
Name
userSamlCredentials
Object Type
Description
The user credentials for authentication by SAML token.
Output Response
Successful Result Code
200
Description of Response Type
The response is the security token as a base64 string. It is usually stored in a cookie.
Notes
The security token is a string that needs to be added to a cookie on the third party host page for any embedded content to ensure the access is authorized. The assumption is that the user has already authenticated via SAML in the hosting application before attempting to authenticate into Pyramid.
Examples
Authenticate User for Embedding with SAML (JavaScript):
This example demonstrates how to authenticate a user for embedding using SAML tokens from JavaScript.
// URL of the Pyramid installation and the path to the API 2.0 REST methods
var pyramidURL = "http://mysite.com/api2/";
function getAuthToken(samlToken) {
var URL = pyramidURL + "/auth/authenticateUserEmbedSAML";
var credentials = {
data: {
domain: document.domain,
token: samlToken,
},
};
fetch(URL, {
method: "POST",
body: JSON.stringify(credentials),
})
.then((response) => response.text())
.then((token) => console.log("fetch: " + token));
}
getAuthToken("SAML TOKEN");