Start the WebPros authentication flow
Changed onThis function starts the WebPros single sign-on flow for 360 Monitoring.
The system records the user agent and the remote IP address in the server's log only. It builds the redirect URI from the WHM session identifier, which it reads from the request when the session_id parameter is absent. The function fails when it cannot determine a session identifier, because a redirect URI without one produces an authentication flow that cannot complete.
The function returns an authorization URL and the state token for this flow. Redirect the user to the authorization URL and store the state token for the duration of the flow. When the user returns to the server, pass the authorization code and the state that the identity provider returned to the 360Monitoring/webpros_auth_callback function.
The system keeps the Proof Key for Code Exchange (PKCE) verifier on the server, stored with the state for this flow. The verifier never reaches the caller, and the 360Monitoring/webpros_auth_callback function does not accept one.
The state token is a single-use secret. Do not log it, and do not use it outside of the WHM session that started the flow. The system binds the flow to that session and rejects a callback that arrives under any other session.
Request
- Base URLhttps://whm-server.tld:2087/json-api
- AuthHTTP basic
Query parameters
The WHM session identifier from which to build the redirect URI. The system reads the identifier from the request path when it is absent, so callers in a browser session do not need to send it. Callers outside of a browser session, such as those using whmapi1 functions from a shell, must send the identifier, and it must consist only of digits.
Response
The HTTP Request succeeded.
Example response
{
"data": {
"auth_url": "https://auth.webpros.com/authorize?client_id=example&code_challenge=Example&response_type=code",
"error": "The system could not determine the WHM session ID. Supply the “session_id” parameter.",
"reason": "missing_parameter",
"state": "Xk7fQ2mR9vLpN4wCbT8yHzA1sD6gJ3eU0iO5nY7kV2q"
},
"metadata": {
"command": "webpros_auth_start",
"namespace": "360Monitoring",
"reason": "OK",
"result": 1,
"version": 1
}
}Changes
- info
endpoint added
- info