This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| pega:authentication [2024/10/21 14:04] – created Niels | pega:authentication [2024/10/21 14:56] (current) – Niels | ||
|---|---|---|---|
| Line 23: | Line 23: | ||
| - pyUserIdentifier -> operator identifier. | - pyUserIdentifier -> operator identifier. | ||
| + | The following can be used in a java step (where myStepPage is the operator page): | ||
| + | |||
| < | < | ||
| tools.putParamValue(" | tools.putParamValue(" | ||
| Line 29: | Line 31: | ||
| + | Likely a token of some sort is expected in the http headers send by client/user to authenticate. | ||
| + | In the authentication context the http headers can be read via following example: | ||
| + | |||
| + | < | ||
| + | ClipboardPage pxRequestorPage = tools.findPage(" | ||
| + | |||
| + | javax.servlet.http.HttpServletRequest request = (javax.servlet.http.HttpServletRequest) pxRequestorPage.getObject(" | ||
| + | authToken = request.getHeader(" | ||
| + | </ | ||
| + | |||
| + | In the example the Authorization header is fetch into a local variable authToken. | ||
| + | |||
| + | |||
| + | To summarize the flow of the activity: | ||
| + | - Get credentials from header | ||
| + | - Verify if credentials are valid and identify the client/ | ||
| + | - Iompose Operator Page (read from db or use template opertor) | ||
| + | - Indicate success by setting the expected pyOperPage and pyUserIdentifier. \\ (If either of the parameters are missing the result will be a 401 unauthorized response.) | ||
| + | |||
| + | * [[https:// | ||
| + | * [[https:// | ||
| - | [[https:// | + | {{tag>[pega custom_authentciation API]}} |