UnknownSession
Class: UnknownSession
Defined in: packages/core/src/session/session.ts:284
Unknown session that allows all keys
Extends
Indexable
[
key:string]:any
Allow any type of fields
Constructors
Constructor
new UnknownSession():
UnknownSession
Returns
UnknownSession
Inherited from
Properties
amr?
optionalamr?:string[]
Defined in: packages/core/src/session/session.ts:85
Authentication methods used
Inherited from
application?
optionalapplication?:ApplicationIdentity
Defined in: packages/core/src/session/session.ts:129
Application (workload) identity when authenticated by OIDC: mutually exclusive with userId
An application session has no current user, so ownership checks never mistake an application for a user
Inherited from
authAt?
optionalauthAt?:number
Defined in: packages/core/src/session/session.ts:111
When the session was authenticated (ms timestamp, stamped by the Authentication service): a session older than the last password change of its user is loaded as anonymous
Inherited from
changed
protectedchanged:boolean=false
Defined in: packages/core/src/session/session.ts:58
Inherited from
clientId?
optionalclientId?:string
Defined in: packages/core/src/session/session.ts:122
OAuth client the bearer token was issued to
Inherited from
identUsed
identUsed:
string
Defined in: packages/core/src/session/session.ts:70
Ident used
Inherited from
mfa?
optionalmfa?:MfaState
Defined in: packages/core/src/session/session.ts:94
MFA state of the session
Inherited from
mfaAt?
optionalmfaAt?:number
Defined in: packages/core/src/session/session.ts:99
When the second factor was last verified (ms timestamp): a proof time, never advanced by a token refresh.
Undefined unless mfa === "verified"; sessions verified before it existed have none and are never fresh
Inherited from
mfaVerifications?
optionalmfaVerifications?:Record<string,MfaVerification>
Defined in: packages/core/src/session/session.ts:100
Inherited from
provider?
optionalprovider?:string
Defined in: packages/core/src/session/session.ts:80
Authentication provider used
Inherited from
refreshFamily?
optionalrefreshFamily?:string
Defined in: packages/core/src/session/session.ts:105
Refresh token family identifier
Inherited from
roles
roles:
string[]
Defined in: packages/core/src/session/session.ts:75
User current roles
Inherited from
scopes?
optionalscopes?:string[]
Defined in: packages/core/src/session/session.ts:117
Operation globs the bearer token is restricted to (OAuth scope); undefined means unrestricted. Never set on cookie sessions.
Inherited from
stateless?
optionalstateless?:boolean
Defined in: packages/core/src/session/session.ts:135
Session is stateless (not persisted in cookies)
Inherited from
transientAmr?
optionaltransientAmr?:string[]
Defined in: packages/core/src/session/session.ts:89
Authentication methods verified only for this request
Inherited from
userId?
optionaluserId?:string
Defined in: packages/core/src/session/session.ts:66
User id
Inherited from
uuid
uuid:
string
Defined in: packages/core/src/session/session.ts:62
Session uuid
Inherited from
Methods
addTransientAmr()
addTransientAmr(
method):void
Defined in: packages/core/src/session/session.ts:248
Add a method proved only for the current request.
Parameters
method
string
authentication method
Returns
void
Inherited from
getPersistentAmr()
getPersistentAmr():
string[]
Defined in: packages/core/src/session/session.ts:255
Returns
string[]
authentication methods safe to persist in a cookie or token
Inherited from
getProxy()
getProxy():
this
Defined in: packages/core/src/session/session.ts:263
Get the proxy to be able to track modification
Returns
this
this for chaining
Inherited from
isApplication()
isApplication():
boolean
Defined in: packages/core/src/session/session.ts:176
If session is authenticated as an application
Returns
boolean
true if the condition is met
Inherited from
isDirty()
isDirty():
boolean
Defined in: packages/core/src/session/session.ts:240
Session is dirty and requires save
Returns
boolean
true if the condition is met
Inherited from
isLogged()
isLogged():
boolean
Defined in: packages/core/src/session/session.ts:204
If session is authenticated
Returns
boolean
true if the condition is met
Inherited from
isPending()
isPending():
boolean
Defined in: packages/core/src/session/session.ts:212
If session is pending MFA verification
Returns
boolean
true if the condition is met
Inherited from
login()
login(
userId,identUsed,options?):void
Defined in: packages/core/src/session/session.ts:143
Login
Parameters
userId
string
the user identifier
identUsed
string
the identity used
options?
LoginOptions = {}
login options including provider, amr, and mfa state
Returns
void
Inherited from
loginApplication()
loginApplication(
application,options?):void
Defined in: packages/core/src/session/session.ts:164
Login an application (workload identity): the session becomes stateless and has no user
Parameters
application
the application identity
options?
authentication methods, ["oidc"] by default
amr?
string[]
authentication methods used
Returns
void
Inherited from
logout()
logout():
void
Defined in: packages/core/src/session/session.ts:183
Logout
Returns
void
Inherited from
markMfaVerified()
markMfaVerified(
amr,now?):void
Defined in: packages/core/src/session/session.ts:222
Record a second factor verified now on an already identified session (login completion or step-up): keeps the
user, ident, provider, authAt and refresh family
Parameters
amr
string[]
second factor method(s) verified, added to the session methods
now?
number = ...
verification time (ms)
Returns
void
Inherited from
mfaAge()
mfaAge(
now?):number
Defined in: packages/core/src/session/session.ts:232
Parameters
now?
number = ...
reference time (ms)
Returns
number
ms since the second factor was verified, Infinity when it never was