Authenticate User with OpenID Authentication

Generates a Pyramid access authentication token using OpenID authentication parameter map

Method

/API2/auth/authenticateUserOPENID
  • API Section: /API2/auth
  • API Version: 2.0
  • From Release: 2020.20
  • Usage: REST API only via POST actions.
  • Usage by:
    • Enterprise Admin
    • Domain Admin
    • Pro
    • Analyst
    • Viewer
    • Basic

Method Signature

Input Parameters

Name

parameterMap

Object Type

BaseUserOpenIdCredentials

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 embedded in every API call to ensure the API calls are authorized. If saved as a cookie in a web browser, it can be used (for the authenticated user) to auto-login into the application. The assumption is that the user has already authenticated via OpenID before attempting to authenticate into Pyramid.

Examples

Authenticate User with OpenID:

This example demonstrates how to authenticate a user using OpenID.

// URL of the Pyramid installation and the path to the API 2.0 REST methods
var pyramidURL = "http://mysite.com/api2/";

// The response from the OpenId authentication var openIdToken = “YOUR_OPEN_ID_TOKEN(RESPONSE)”;

//generic method for running REST methods function callApi(path, data, parseResult = true) { var xhttp = new XMLHttpRequest(); xhttp.open(“POST”, pyramidURL + path, false); xhttp.send(JSON.stringify(data)); if (parseResult) { return JSON.parse(xhttp.responseText); } else { return xhttp.responseText; } }

//calling the API to receive the Pyramid token let pyramidToken = callApi( “auth/authenticateUserOPENID”, { data: { parameterMap: { id_token: openIdToken, state: “preferred_username”, }, }, }, false ); console.log(“fetch: " + pyramidToken);