AuthenticationToken

AuthenticationToken

认证 Token 类,主要用于在 Subject 中进行实例化或者调用 subject.login 需要传递的参数,再传递给 Realm 使用

Constructor

new AuthenticationToken(options)

Source:
Example
subject.login(new AuthenticationToken('zhangsan','123456'))
Parameters:
Name Type Description
options object 选项对象
Properties
Name Type Description
principals string 用户身份,比如账号、用户名、邮箱等
credentials string 用户凭证,比如密码、第三方授权token等
uuid string | number 与数据源对应的唯一id,未认证的情况下没有

Members

(protected) credentials

Source:
用户凭据

(protected) principals

Source:
用户身份

(protected) uuid

Source:
Default Value:
  • null
用户唯一 id

Methods

getCredentials() → {string}

Source:
获取用户凭证
Returns:
Type
string

getPrincipals() → {string}

Source:
获取用户身份
Returns:
Type
string

getUUID() → {string|number}

Source:
获取用户的 UUID
Returns:
Type
string | number