« Back to Product

Documentation

RegisterOAuth

Require: Symcon >= 8.1

 boolean RegisterOAuth (string $Identifier) 

Parameters

Identifier

Identifier of the OAuth handler

Returns

If the command could be executed successfully, the result is TRUE, otherwise FALSE.

Description

This function registers an OAuth handler with the identifier in the OAuth Control. When the OAuth process is completed, the function ProcessOAuthData of this module is called.

The registered OAuth handler is volatile. On a restart, it is removed until the RegisterOAuth function is executed again by the instance, which typically happens as part of the restart in Create. This means that the module does not have to clean up when it is deleted and the OAuth handler is automatically removed when the instance is deleted.

Warning

This function can normally only be used for IPSModuleStrict. For the old IPSModule, however, the base class WebOAuthModule can be downloaded and extended. However, the functionality of the base class is not recommended for IPSModuleStrict, as an OAuth handler registered in this way is not volatile and must therefore be cleaned up manually.

Example

// IPSModuleStrict
public function Create(): void {

    // Do not remove this line
    parent::Create();

    $this->RegisterOAuth('my-module');
}

// IPSModule
// This function can only be used natively for IPSModuleStrict
// Using the base class WebOAuthModule enables a comparable use in IPSModule
Any questions?