class MicrosoftOauthClient extends OAuthClientHook

Class MicrosoftOauthClient

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
protected $description
protected $icon_class
protected $max_user_connections
protected $max_global_connections
protected OauthAccess $oauthAccess from  OAuthClientHook
protected $endpoint
protected $scope

Methods

bool
checkClientAfterAuthorization(OAuthClient $client)

No description

createOAuthClient(string $client_id, string $client_secret = '', string|null $redirectURL = null)

Return OAuth Client

bool|string
createState(string|null $redirect_url = null)

Get a state value for OAuth flow

getConnectedClient(string $type = 'personal')

Get connected client which belongs to specific oauth hook.

string
getDescription()

Get description for the OAuth Client Hook will be used in create modal client

string
getHookDescription()

No description

from  BaseHook
string
getHookIdentifier()

Get Hook identifier consists of instance_id puncto separator and hook name Ex. instance_id.name

from  BaseHook
array
getHookInfoValue(bool $key = false)

Return Hook information (ID, InstanceID, Name, Hook Type, Object Type, ...)

from  BaseHook
string
getHookInstance()

No description

from  BaseHook
string
getHookName()

No description

from  BaseHook
string
getHookTitle()

No description

from  BaseHook
string
getIconClass()

Get icon for the OAuth Client Hook will be used in create modal client

getOAuthClient(string $internal_redirect_url = null)

Return OAuthClient to Webservices

getOAuthModel(string $hookName, string $hookInstance, int $userId)

No description

getObject()

No description

from  BaseHook
mixed
getOption(string $key)

Returns the option with $key set in the config.yml

from  BaseHook
string
getTitle()

Get title for the OAuth Client Hook will be used in create modal client

get_connection_fdl()

TODO: What if the service requires the user to enter something during the connection?

bool
hasConnectedClient(string $type = 'personal')

Check wether the user has a connected OAuth Client

init()

Webservice Mod will be initialized

init_service()

Called from init, use to setup your configuration settings within the hook (optional)

bool
isAllowedExplicitConnection()

No description

bool
isAllowedMultipleForUsers()

No description

bool
isAllowedMultipleGlobal()

No description

bool
isAvailable()

Returns true if this hook is available otherwise false.

bool
isBasicAuthorization()

No description

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)

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)

bool
isModelValid(string|null $hookName = null, string|null $hookInstance = null, int $userId = OAuthClient::GENERAL_ADMIN_MODE)

No description

bool
isSingleForUsers()

No description

bool
isSingleGlobal()

No description

onBeforeDeleteClient(OAuthClient $oauthClient, int $userID = null)

No description

onBeforeSaveClient(OAuthClient $oauthClient, array $decodedState = [])

No description

OpenIDConfiguration|null
parseOpenIDConfiguration(string $url)

Parse OpenID OpenIDConfiguration for OAuth Service Endpoints

OpenIDConfiguration|null
parseOpenIDConfigurationForDomain(string $domain)

Parse OpenID OpenIDConfiguration for OAuth Service Endpoints

OpenIDConfiguration|null
parseOpenIDConfigurationForURL(string $url)

Parse OpenID OpenIDConfiguration for URL

int|bool
saveOAuthAccess(OAuthClient $client, $hook_name, $hook_instance)

Save and encrypt oauth data to database

setIsBasicAuthorization(bool $isBasicAuthorization)

No description

void
setModelInvalid(string|null $hookName = null, string|null $hookInstance = null, int|null $userId = null)

No description

void
setModelValid(string|null $hookName = null, string|null $hookInstance = null, int $userId = OAuthClient::GENERAL_ADMIN_MODE)

No description

Details

at line 106
bool checkClientAfterAuthorization(OAuthClient $client)

No description

Parameters

OAuthClient $client

Return Value

bool

True - client is good and should be saved, False - client connection is not good

in OAuthClientHook at line 187
final OAuthClient createOAuthClient(string $client_id, string $client_secret = '', string|null $redirectURL = null)

Return OAuth Client

Parameters

string $client_id
string $client_secret
string|null $redirectURL

Redirect triggered AFTER successful authflow

Return Value

OAuthClient

in OAuthClientHook at line 96
final bool|string createState(string|null $redirect_url = null)

Get a state value for OAuth flow

Parameters

string|null $redirect_url

Return Value

bool|string

in OAuthClientHook at line 306
OAuthClient getConnectedClient(string $type = 'personal')

Get connected client which belongs to specific oauth hook.

Parameters

string $type

Return Value

OAuthClient

Exceptions

InvalidArgumentException
IdentityProviderException

in OAuthClientHook at line 154
string getDescription()

Get description for the OAuth Client Hook will be used in create modal client

Return Value

string

in BaseHook at line 76
string getHookDescription()

No description

Return Value

string

in BaseHook at line 55
string getHookIdentifier()

Get Hook identifier consists of instance_id puncto separator and hook name Ex. instance_id.name

Return Value

string

in BaseHook at line 45
array getHookInfoValue(bool $key = false)

Return Hook information (ID, InstanceID, Name, Hook Type, Object Type, ...)

Parameters

bool $key

Return Value

array

in BaseHook at line 69
string getHookInstance()

No description

Return Value

string

in BaseHook at line 62
string getHookName()

No description

Return Value

string

in BaseHook at line 83
string getHookTitle()

No description

Return Value

string

in OAuthClientHook at line 174
string getIconClass()

Get icon for the OAuth Client Hook will be used in create modal client

Return Value

string

at line 47
OAuthClient getOAuthClient(string $internal_redirect_url = null)

Return OAuthClient to Webservices

Parameters

string $internal_redirect_url

Return Value

OAuthClient

in OAuthClientHook at line 368
OauthAccess getOAuthModel(string $hookName, string $hookInstance, int $userId)

No description

Parameters

string $hookName
string $hookInstance
int $userId

Return Value

OauthAccess

Exceptions

UnexpectedValueException

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

Parameters

string $key

Return Value

mixed

in OAuthClientHook at line 164
string getTitle()

Get title for the OAuth Client Hook will be used in create modal client

Return Value

string

in OAuthClientHook at line 502
get_connection_fdl()

TODO: What if the service requires the user to enter something during the connection?

in OAuthClientHook at line 281
bool hasConnectedClient(string $type = 'personal')

Check wether the user has a connected OAuth Client

Parameters

string $type

Return Value

bool

in OAuthClientHook at line 72
final init()

Webservice Mod will be initialized

in OAuthClientHook at line 85
init_service()

Called from init, use to setup your configuration settings within the hook (optional)

at line 219
bool isAllowedExplicitConnection()

No description

Return Value

bool

in OAuthClientHook at line 130
bool isAllowedMultipleForUsers()

No description

Return Value

bool

in OAuthClientHook at line 123
bool isAllowedMultipleGlobal()

No description

Return Value

bool

at line 228
bool isAvailable()

Returns true if this hook is available otherwise false.

Return Value

bool

in OAuthClientHook at line 509
bool isBasicAuthorization()

No description

Return Value

bool

in OAuthClientHook 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)

Return Value

bool

in OAuthClientHook 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)

Return Value

bool

in OAuthClientHook at line 388
bool isModelValid(string|null $hookName = null, string|null $hookInstance = null, int $userId = OAuthClient::GENERAL_ADMIN_MODE)

No description

Parameters

string|null $hookName
string|null $hookInstance
int $userId

Return Value

bool

in OAuthClientHook at line 144
bool isSingleForUsers()

No description

Return Value

bool

in OAuthClientHook at line 137
bool isSingleGlobal()

No description

Return Value

bool

at line 202
onBeforeDeleteClient(OAuthClient $oauthClient, int $userID = null)

No description

Parameters

OAuthClient $oauthClient
int $userID

Exceptions

GraphException
IdentityProviderException

at line 151
onBeforeSaveClient(OAuthClient $oauthClient, array $decodedState = [])

No description

Parameters

OAuthClient $oauthClient
array $decodedState

= ['redirect_url' => '']

in OAuthClientHook at line 265
protected OpenIDConfiguration|null parseOpenIDConfiguration(string $url)

Parse OpenID OpenIDConfiguration for OAuth Service Endpoints

Parameters

string $url

https://www.example.com/.well-known/openid-configuration

Return Value

OpenIDConfiguration|null

in OAuthClientHook at line 242
protected OpenIDConfiguration|null parseOpenIDConfigurationForDomain(string $domain)

Parse OpenID OpenIDConfiguration for OAuth Service Endpoints

Parameters

string $domain www.example.com

Return Value

OpenIDConfiguration|null

in OAuthClientHook at line 254
protected OpenIDConfiguration|null parseOpenIDConfigurationForURL(string $url)

Parse OpenID OpenIDConfiguration for URL

Parameters

string $url

https://example.com/.well-known/openid-configuration;

Return Value

OpenIDConfiguration|null

in OAuthClientHook at line 465
int|bool saveOAuthAccess(OAuthClient $client, $hook_name, $hook_instance)

Save and encrypt oauth data to database

Parameters

OAuthClient $client
$hook_name
$hook_instance

Return Value

int|bool

Exceptions

IdentityProviderException
Exception

in OAuthClientHook at line 518
OAuthClientHook setIsBasicAuthorization(bool $isBasicAuthorization)

No description

Parameters

bool $isBasicAuthorization

Return Value

OAuthClientHook

in OAuthClientHook at line 423
void setModelInvalid(string|null $hookName = null, string|null $hookInstance = null, int|null $userId = null)

No description

Parameters

string|null $hookName
string|null $hookInstance
int|null $userId

Return Value

void

Exceptions

Exception

in OAuthClientHook at line 405
void setModelValid(string|null $hookName = null, string|null $hookInstance = null, int $userId = OAuthClient::GENERAL_ADMIN_MODE)

No description

Parameters

string|null $hookName
string|null $hookInstance
int $userId

Return Value

void

Exceptions

Exception