- Created by Documentation, last modified on Jul 17, 2019
disable_authentication_provider
disable_failing_authentication_providers
enable_authentication_provider
get_available_authentication_providers
get_provider_client_configurations
get_provider_configuration_fields
get_provider_display_configurations
get_users_authn_linked_accounts
set_provider_client_configurations
set_provider_display_configurations
twofactorauth_generate_tfa_config
twofactorauth_get_user_configs
cpgreylist_is_server_netblock_trusted
cpgreylist_list_entries_for_common_mail_provider
cpgreylist_load_common_mail_providers_config
cpgreylist_save_common_mail_providers_config
cpgreylist_trust_entries_for_common_mail_provider
cpgreylist_untrust_entries_for_common_mail_provider
create_cpgreylist_trusted_host
delete_cpgreylist_trusted_host
block_incoming_email_from_country
block_incoming_email_from_domain
expunge_messages_for_mailbox_guid
get_unique_recipient_count_per_sender_for_user
get_unique_sender_recipient_count_per_user
get_user_email_forward_destination
list_blocked_incoming_email_countries
list_blocked_incoming_email_domains
set_user_email_forward_destination
unblock_incoming_email_from_country
unblock_incoming_email_from_domain
Description
This function validates the OAuth2 code from the cPanel Customer Portal.
After the function validates the token, the system stores it on the current session.Examples
https://hostname.example.com:2087/cpsess##########/json-api/ticket_validate_oauth2_code?api.version=1&code=84b1a729-63e3-11e6-a0fb-bfcf357fd76d&redirect_uri=https%3A%2F%2Fhostname.example.com%2F
https://hostname.example.com:2087/cpsess##########/xml-api/ticket_validate_oauth2_code?api.version=1&code=84b1a729-63e3-11e6-a0fb-bfcf357fd76d&redirect_uri=https%3A%2F%2Fhostname.example.com%2F
Warning:
You cannot use this method to call the function.
{ "metadata": { "reason": "OK", "version": 1, "command": "ticket_validate_oauth2_code", "result": 1 } }
<result> <metadata> <reason>OK</reason> <version>1</version> <command>ticket_validate_oauth2_code</command> <result>1</result> </metadata> </result>
Note:
Parameters
Parameter | Type | Description | Possible values | Example |
---|---|---|---|---|
code | string | Required The code from the OAuth2 redirect. The system validates this code and exchanges it for a token. | An OAuth2 code. |
|
| integer | Required The redirect URI query argument that the system sent to the initial OAuth2 authentication endpoint. | A valid URL. |
|
Returns
This function only returns metadata.
Function information
API Version:
Available in:
WHM 60+
Methods:
GET, POST
Required Parameters:
code
, redirect_uri
Return Formats:
About WHM API 1
WHM API 1 performs functions and accesses data in WHM.
Notes:
- Some functions and parameters may require that you authenticate as the
root
user. - You must use the appropriate WHM ports (
2086
or2087
) to call WHM API functions.
Find a function
Related functions
-
Page:WHM API 1 Functions - ticket_create_stub_ticket — This function creates a stub ticket.
-
Page:WHM API 1 Functions - ticket_get_support_agreement — This function retrieves the Technical Support Agreement text and metadata about the user's agreement status from the cPanel Customer Portal.
-
Page:WHM API 1 Functions - ticket_grant — This function installs an SSH key from the cPanel Customer Portal.
-
Page:WHM API 1 Functions - ticket_list — This function lists all active and open support tickets from the cPanel Customer Portal.
-
Page:WHM API 1 Functions - ticket_remove_closed — This function removes cPanel Support's SSH keys and removes closed support tickets.