Bitrix API

Office365 extends OAuth

Table of Contents

Constants

MOBILE_TYPE  = 'mobile'
WEB_TYPE  = 'web'

Methods

buildMeta()  : string
Returns packed metadata for instance
convertTokenExpiresToUnixtimeIfNeed()  : int
Convert expires to unixtime, because it can be interval like 3600 seconds or date
getAccessToken()  : bool
Obtains tokens from service
getControllerUrl()  : mixed
getInstance()  : OAuth|false
Returns helper instance
getInstanceByMeta()  : OAuth|false
Returns helper instance by packed metadata
getKnownServices()  : array<string|int, mixed>
Returns the list of supported services
getOAuthEntity()  : mixed
Returns service interface entity
getPublicUserData()  : UserData
getRedirect()  : string
Returns server OAuth handler URI
getServiceName()  : string
Returns service name
getStoredToken()  : string|null
Returns token by instance UID
getStoredUid()  : string
Returns instance UID
getTokenByMeta()  : string|null
Returns token by packed metadata
getUrl()  : string
Returns service OAuth endpoint URI
getUserData()  : array<string|int, mixed>|null
Returns user data
getUserDataByMeta()  : array<string|int, mixed>|null
Returns user data by packed metadata
handleResponse()  : void
Handles service response
parseMeta()  : array<string|int, mixed>
Returns unpacked metadata
saveResponse()  : bool

Constants

MOBILE_TYPE

public mixed MOBILE_TYPE = 'mobile'

WEB_TYPE

public mixed WEB_TYPE = 'web'

Methods

buildMeta()

Returns packed metadata for instance

public buildMeta() : string
Tags
throws
ObjectException
Return values
string

convertTokenExpiresToUnixtimeIfNeed()

Convert expires to unixtime, because it can be interval like 3600 seconds or date

public static convertTokenExpiresToUnixtimeIfNeed(int $intervalOrTime) : int
Parameters
$intervalOrTime : int

Unixtime or seconds to expire

Return values
int

getAccessToken()

Obtains tokens from service

public getAccessToken([string $code = null ]) : bool
Parameters
$code : string = null

Service authorization code.

Return values
bool

getControllerUrl()

public getControllerUrl() : mixed

getInstance()

Returns helper instance

public static getInstance([string $service = null ]) : OAuth|false
Parameters
$service : string = null

Service name.

Return values
OAuth|false

getInstanceByMeta()

Returns helper instance by packed metadata

public static getInstanceByMeta(string $meta) : OAuth|false
Parameters
$meta : string

Packed metadata.

Return values
OAuth|false

getKnownServices()

Returns the list of supported services

public static getKnownServices() : array<string|int, mixed>
Return values
array<string|int, mixed>

getOAuthEntity()

Returns service interface entity

public getOAuthEntity() : mixed

getRedirect()

Returns server OAuth handler URI

public getRedirect([bool $final = true ]) : string
Parameters
$final : bool = true

Skip Bitrix24 proxy.

Return values
string

getServiceName()

Returns service name

public static getServiceName() : string
Return values
string

getStoredToken()

Returns token by instance UID

public getStoredToken([string $uid = null ][, int $expireGapSeconds = 10 ]) : string|null
Parameters
$uid : string = null

Instance UID.

$expireGapSeconds : int = 10

Gap needed for using token, to ensure when we use token it still alive

Return values
string|null

getStoredUid()

Returns instance UID

public getStoredUid() : string
Return values
string

getTokenByMeta()

Returns token by packed metadata

public static getTokenByMeta(string $meta[, int $expireGapSeconds = 10 ]) : string|null
Parameters
$meta : string

Packed metadata.

$expireGapSeconds : int = 10

Gap needed for using token, to ensure when we use token it still alive

Return values
string|null

getUrl()

Returns service OAuth endpoint URI

public getUrl() : string
Return values
string

getUserData()

Returns user data

public getUserData([bool $secure = true ]) : array<string|int, mixed>|null
Parameters
$secure : bool = true

Strip raw data (includes tokens).

Return values
array<string|int, mixed>|null

getUserDataByMeta()

Returns user data by packed metadata

public static getUserDataByMeta(string $meta[, bool $secure = true ]) : array<string|int, mixed>|null
Parameters
$meta : string

Packed metadata.

$secure : bool = true

Strip raw data (includes tokens).

Return values
array<string|int, mixed>|null

handleResponse()

Handles service response

public handleResponse(array<string|int, mixed> $state[, mixed $context = self::WEB_TYPE ]) : void
Parameters
$state : array<string|int, mixed>

Response data.

$context : mixed = self::WEB_TYPE

parseMeta()

Returns unpacked metadata

public static parseMeta(string $meta) : array<string|int, mixed>
Parameters
$meta : string

Packed metadata.

Return values
array<string|int, mixed>

saveResponse()

public saveResponse(mixed $state) : bool
Parameters
$state : mixed
Return values
bool

        
On this page

Search results