--- title: "system.perspective.authenticationChallenge" description: "Triggers an authentication challenge action." --- # system.perspective.authenticationChallenge > Triggers an authentication challenge action. This function is used in **Python Scripting**. ## Description Triggers an [authentication challenge](ignition-modules\perspective\working-with-perspective-components\component-events-and-actions.md#authentication-challenge-action) action. ## Syntax `system.perspective.authenticationChallenge([sessionId], [pageId], [idp], [forceAuth], [timeout], [payload], [framing])` ### Parameters Type | Parameter | Description ------- | ------- | ------ String| `sessionId` | Identifier of the Session to target. If omitted, the current Session will be used automatically. When targeting a different Session, then the pageId parameter must be included in the call. [optional] String| `pageId` | Identifier of the page to target. If omitted, the current page will be used. [optional] String| `idp` | The name of the IdP to use for this authentication challenge. If omitted, the Project default IdP will be used. [optional] Boolean| `forceAuth` | True if Ignition should ask the IdP to re-authenticate the user, even if the user is already signed into the IdP. False if Ignition should not ask the IdP to re-authenticate the user. If the IdP supports this option, the IdP will ask the user to re-enter their credentials, even if the user is already signed into the IdP. If omitted, the default value for this argument will fall back to the value in the Project Properties. [optional] Integer| `timeout` | The number of minutes the system will wait in between the authentication request and the authentication response before timing out the request. If set to any number <= zero, the request is rejected. If omitted, the default of two minutes will be used as the timeout. [optional] Any| `payload` | An opaque payload object that may contain any information. This object will be passed to the [onAuthenticationChallengeCompleted](ignition-modules\perspective\scripting-in-perspective\perspective-session-events-scripts.md#authentication-challenge-example) Session event script. The payload should be a JSON-encodable data structure. [optional] String| `framing` | A string representing the type of framing that should be used. **self**: indicates that the same window should be used.**new**: Indicates that a new tab should be used.**embedded**: indicates that an embedded Iframe should be used. Some IDPs may require Content-Security-Policy or other configuration changes to display their login page in the Session's Iframe. If omitted, the default value of `self` (same window) is used. [optional]**Note:** Perspective Workstation Sessions do not support `new` and will fall back to `self`. Mobile Sessions only support `self`. ### Returns Nothing ### Scope Gateway, Perspective Session :::note This function will only work in the Gateway scope if both `sessionId` and `pageId` are supplied to the call. ::: ## Code Examples ```python title="Code Snippet" # Opens an authentication challenge in a new tab that will time out in three minutes. system.perspective.authenticationChallenge(idp = "administrators", timeout = 3, payload = {"isAction":"true"}, framing = "new") ```