Authenticate User for Embedding with OpenID Authentication
{ authenticateUserEmbedOPENID }
Generates a Pyramid access authentication token for embedding using OpenID parameter map
Method
- Enterprise Admin
- Domain Admin
- Pro
- Analyst
- Viewer
- Basic
Input Parameters
Name
userOpenIdCredentials
Object Type
Description
The user credentials for authentication by OpenID parameter map.
Output Response
Successful Result Code
200
Response Type
string
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 OPENID in the hosting application before attempting to authenticate into Pyramid.
Examples
This example demonstrates how to authenticate a user for embedding using OpenID.
// URL of the Pyramid installation and the path to the API 2.0 REST methods var pyramidURL = "http://mysite.com/api2/"; // Domain of the Pyramid installation var domainName = "YOUR_DOMAIN" // The response from the OpenId authentication var openIdToken = "YOUR_OPEN_ID_TOKEN(RESPONSE)"; function getAuthToken() { var URL = pyramidURL + "/auth/authenticateUserEmbedOPENID"; var credentials = { data: { parameterMap: { id_token: openIdToken, state: "preferred_username", }, domain: domainName, }, }; fetch(URL, { method: "POST", credentials: "include", body: JSON.stringify(credentials), }) .then((response) => response.text()) .then((token) => console.log("fetch: " + token)); } getAuthToken();