OAuthClientHook
abstract class OAuthClientHook extends BaseHook
Class OAuthClient
Constants
| NO_CONNECTION_LIMIT |
|
Properties
| Controller | $mod | Instance providing the hook |
from BaseHook |
| array | $_hook_info | Hook Information "id" => "4914" "instance_id" => "api_microsoft" "name" => "oauth_client" "hook" => "webservice.oauth_client" "type" => "object" "registry_name" => "oauth_client" "function_name" => "" "internal" => "no" "dep_mode" => "local" "active" => "yes" "title" => "Basic functions" "description" => "" "options" => "" |
from BaseHook |
| protected | $title | Title for this OAuth Client Hook will be used in create modal client |
|
| protected | $description | Description for the OAuth Client Hook will be used in create modal client |
|
| protected | $icon_class | Client Icon for the OAuth Client Hook |
|
| protected int | $max_user_connections | How many client connections are allowed per user |
|
| protected int | $max_global_connections | How many client connections are allowed on global level |
|
| protected OauthAccess | $oauthAccess |
Methods
You can check/process the client connection before the client is saved as oauth_access in webservices, this point can also be used to do custom redirects
Return OAuth Client
Get a state value for OAuth flow
Get connected client which belongs to specific oauth hook.
Get description for the OAuth Client Hook will be used in create modal client
Get Hook identifier consists of instance_id puncto separator and hook name Ex. instance_id.name
Return Hook information (ID, InstanceID, Name, Hook Type, Object Type, ...)
Get icon for the OAuth Client Hook will be used in create modal client
No description
No description
Get title for the OAuth Client Hook will be used in create modal client
TODO: What if the service requires the user to enter something during the connection?
Check wether the user has a connected OAuth Client
Webservice Mod will be initialized
Called from init, use to setup your configuration settings within the hook (optional)
Returns whether the client allows an explicit connection triggered by the user e.g. via button.
No description
No description
No description
Returns if this API should be connectable by users in their settings Default will evaluate max_user_connections Override this method to implement your own logic (e.g. policy based)
Returns if this API should be connectable by by administrators in global mode Default will evaluate max_global_connections Override this method to implement your own logic (e.g. policy based)
No description
No description
No description
Method will be called when user or admin disconnects/removes account within user settings
Method will be called after successful authentication shortly before OAuth access is persisted to DB permamently
Parse OpenID OpenIDConfiguration for OAuth Service Endpoints
Parse OpenID OpenIDConfiguration for OAuth Service Endpoints
Parse OpenID OpenIDConfiguration for URL
Save and encrypt oauth data to database
No description
No description
No description
Details
at line 201
bool
checkClientAfterAuthorization(OAuthClient $client)
You can check/process the client connection before the client is saved as oauth_access in webservices, this point can also be used to do custom redirects
at line 187
final OAuthClient
createOAuthClient(string $client_id, string $client_secret = '', string|null $redirectURL = null)
Return OAuth Client
at line 96
final bool|string
createState(string|null $redirect_url = null)
Get a state value for OAuth flow
at line 306
OAuthClient
getConnectedClient(string $type = 'personal')
Get connected client which belongs to specific oauth hook.
at line 154
string
getDescription()
Get description for the OAuth Client Hook will be used in create modal client
in
BaseHook at line 76
string
getHookDescription()
No description
in
BaseHook at line 55
string
getHookIdentifier()
Get Hook identifier consists of instance_id puncto separator and hook name Ex. instance_id.name
in
BaseHook at line 45
array
getHookInfoValue(bool $key = false)
Return Hook information (ID, InstanceID, Name, Hook Type, Object Type, ...)
in
BaseHook at line 69
string
getHookInstance()
No description
in
BaseHook at line 62
string
getHookName()
No description
in
BaseHook at line 83
string
getHookTitle()
No description
at line 174
string
getIconClass()
Get icon for the OAuth Client Hook will be used in create modal client
at line 496
abstract OAuthClient
getOAuthClient(string $internal_redirect_url = null)
No description
at line 368
OauthAccess
getOAuthModel(string $hookName, string $hookInstance, int $userId)
No description
in
BaseHook at line 88
getObject()
No description
in
BaseHook at line 97
mixed
getOption(string $key)
Returns the option with $key set in the config.yml
at line 164
string
getTitle()
Get title for the OAuth Client Hook will be used in create modal client
at line 502
get_connection_fdl()
TODO: What if the service requires the user to enter something during the connection?
at line 281
bool
hasConnectedClient(string $type = 'personal')
Check wether the user has a connected OAuth Client
at line 72
final
init()
Webservice Mod will be initialized
at line 85
init_service()
Called from init, use to setup your configuration settings within the hook (optional)
at line 231
bool
isAllowedExplicitConnection()
Returns whether the client allows an explicit connection triggered by the user e.g. via button.
at line 130
bool
isAllowedMultipleForUsers()
No description
at line 123
bool
isAllowedMultipleGlobal()
No description
in
BaseHook at line 117
abstract bool
isAvailable()
Returns true if this hook is available otherwise false.
at line 509
bool
isBasicAuthorization()
No description
at line 106
bool
isHiddenForUsers()
Returns if this API should be connectable by users in their settings Default will evaluate max_user_connections Override this method to implement your own logic (e.g. policy based)
at line 116
bool
isHiddenGlobal()
Returns if this API should be connectable by by administrators in global mode Default will evaluate max_global_connections Override this method to implement your own logic (e.g. policy based)
at line 388
bool
isModelValid(string|null $hookName = null, string|null $hookInstance = null, int $userId = OAuthClient::GENERAL_ADMIN_MODE)
No description
at line 144
bool
isSingleForUsers()
No description
at line 137
bool
isSingleGlobal()
No description
at line 221
onBeforeDeleteClient(OAuthClient $oauthClient, int $userID = null)
Method will be called when user or admin disconnects/removes account within user settings
at line 211
onBeforeSaveClient(OAuthClient $oauthClient, array $decodedState = [])
Method will be called after successful authentication shortly before OAuth access is persisted to DB permamently
at line 265
protected OpenIDConfiguration|null
parseOpenIDConfiguration(string $url)
Parse OpenID OpenIDConfiguration for OAuth Service Endpoints
at line 242
protected OpenIDConfiguration|null
parseOpenIDConfigurationForDomain(string $domain)
Parse OpenID OpenIDConfiguration for OAuth Service Endpoints
at line 254
protected OpenIDConfiguration|null
parseOpenIDConfigurationForURL(string $url)
Parse OpenID OpenIDConfiguration for URL
at line 465
int|bool
saveOAuthAccess(OAuthClient $client, $hook_name, $hook_instance)
Save and encrypt oauth data to database
at line 518
OAuthClientHook
setIsBasicAuthorization(bool $isBasicAuthorization)
No description
at line 423
void
setModelInvalid(string|null $hookName = null, string|null $hookInstance = null, int|null $userId = null)
No description
at line 405
void
setModelValid(string|null $hookName = null, string|null $hookInstance = null, int $userId = OAuthClient::GENERAL_ADMIN_MODE)
No description