class Sso

单点登录

Traits

AppTrait

Constants

SSO_NONE

SSO_GROUP

SSO_DEVICE_NUM

GROUP_UNLIMITED

GROUP_KICKED

Properties

protected Resp $error error from  AppTrait
protected Resp $success success from  AppTrait

Methods

getError()

获取错误

from  AppTrait
bool
setError(string|MessageBag $error)

设置错误

from  AppTrait
getSuccess()

Get success messages;

from  AppTrait
bool
setSuccess(Resp|string $success)

No description

from  AppTrait
__construct()

No description

bool
handle(PamAccount $pam, string $device_id, string $device_type, string $token)

No description

void
validateUser($pamId)

使用户可用

void
banUser(int $pamId)

禁用用户和 token

void
banToken(PamToken $pt, bool $delete = true)

根据 Token 禁用并移除 Token

int
clearExpired()

No description

void
logout(int $id, string $token)

SSO 退出登录

static bool
isEnable()

是否启用 sso 登录

static array|string
kvType(string $key = null, bool $check_exists = false)

No description

array|string
groupDesc($str = false)

返回组说明

string
groupType(string $os)

是否 OS 不设限

Details

in AppTrait at line 32
Resp getError()

获取错误

Return Value

Resp

in AppTrait at line 45
bool setError(string|MessageBag $error)

设置错误

Parameters

string|MessageBag $error error

Return Value

bool

in AppTrait at line 82
Resp getSuccess()

Get success messages;

Return Value

Resp

in AppTrait at line 100
bool setSuccess(Resp|string $success)

No description

Parameters

Resp|string $success 设置的成功信息

Return Value

bool

at line 46
__construct()

No description

at line 68
bool handle(PamAccount $pam, string $device_id, string $device_type, string $token)

No description

Parameters

PamAccount $pam
string $device_id

设备 ID

string $device_type 设备类型
string $token token

Return Value

bool

Exceptions

Exception

at line 167
void validateUser($pamId)

使用户可用

Parameters

$pamId

Return Value

void

at line 179
void banUser(int $pamId)

禁用用户和 token

Parameters

int $pamId

Return Value

void

Exceptions

Exception

at line 197
void banToken(PamToken $pt, bool $delete = true)

根据 Token 禁用并移除 Token

Parameters

PamToken $pt
bool $delete

Return Value

void

Exceptions

Exception

at line 221
int clearExpired()

No description

Return Value

int

Exceptions

Exception

at line 241
void logout(int $id, string $token)

SSO 退出登录

Parameters

int $id

用户 ID

string $token

JWT Token

Return Value

void

Exceptions

Throwable

at line 261
static bool isEnable()

是否启用 sso 登录

Return Value

bool

at line 272
static array|string kvType(string $key = null, bool $check_exists = false)

No description

Parameters

string $key Key
bool $check_exists 检测键值是否存在

Return Value

array|string

at line 286
array|string groupDesc($str = false)

返回组说明

Parameters

$str

Return Value

array|string

at line 304
string groupType(string $os)

是否 OS 不设限

Parameters

string $os

Return Value

string