Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

C/C++ API Documentation | 2025.2

# ClientSSO::Authorize( StrDict &vars, int maxLength, StrBuf &result )

The method that determines how the client handles the P4LOGINSSO request.

Virtual? | Yes |
Class | ClientSSO |
Arguments | `StrDict &vars` | A dictionary of keys and values
| `int maxLength` | The maximum length of the resulting token. If longer, will be truncated.
| `StrBuf &result` | A string buffer to store the token.
Returns | `0` | Returns non-zero if progress indicators are desired, 0 otherwise.

## Notes

This will receive context in the form of a dictionary of keys and values, the `maxLength` of the resulting token and a `StrBuf` to store the token. If the token is larger the maximum length, the token is truncated. The return type determines how the client handles the `P4LOGINSSO` request:

Return value | Behavior
--- | ---
`CSS_PASS` | SSO succeeded (result is an authentication token) - the server will attempt to verify the token as authentication.
`CSS_FAIL` | SSO failed (result will be logged as error message) - the server will log and report back the error written to the result StrBuf.
`CSS_UNSET` | Client has no SSO support - the server will fall back to an alternative authentication mechanism or reject the login.
`CSS_EXIT` | Stop login process - the login will be cancelled gracefully without an error.
`CSS_SKIP` | Fall back to default P4API behavior - invoke `P4LOGINSSO` if set.

For the P4API to invoke the subclassed ClientSSO `Authorize` method, `ClientUser::GetSSOHandler()` must return an instance of the ClientSSO subclass. This may be done in either of two ways:

- By setting an instance of ClientSSO on ClientUser with `ClientUser::SetSSOHandler()`, which causes the ClientSSO to be deleted when ClientUser is deleted.

- By overloading `ClientUser::GetSSOHandler()` in a custom ClientUser subclass. If you chose to do this, the ClientSSO should have a lifetime that matches the ClientUser because the P4API will not attempt to delete the ClientSSO instance.

## See also

`ClientUser::GetSSOHandler()` `ClientUser::SetSSOHandler()`

Your search for returned results