Skip to content

AuthManager Class

Designed for managing authentication in Bitrix24 applications. It handles authentication data received from the parent window and provides methods for updating and retrieving this data.

ts
// ... /////
$b24 = await initializeB24Frame()
if($b24.auth.isAdmin)
{
	// ... ////
}

TIP

You can test working with B24Frame.auth in this example.

Getters

isAdmin

ts
get isAdmin(): boolean

Returns true if the current user has admin rights, otherwise false. Similar to function

Methods

INFO

Implements the AuthActions interface.

getAuthData

ts
getAuthData(): false|AuthData

Returns authentication data (AuthData) if it has not expired. If expired, returns false. Similar to function

refreshAuth

ts
async refreshAuth(): Promise<AuthData>

Refreshes authentication data through the parent window and returns the updated data (AuthData). Similar to function

getUniq

ts
getUniq(prefix: string): string

Returns a unique string consisting of the given prefix and AuthData.memberId.

Used in 'B24PullClientManager'

Released under the MIT License.