Skip to main content

UnknownSession

@webda/core


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​

Session.constructor

Properties​

amr?​

optional amr?: string[]

Defined in: packages/core/src/session/session.ts:85

Authentication methods used

Inherited from​

Session.amr


application?​

optional application?: 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​

Session.application


authAt?​

optional authAt?: 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​

Session.authAt


changed​

protected changed: boolean = false

Defined in: packages/core/src/session/session.ts:58

Inherited from​

Session.changed


clientId?​

optional clientId?: string

Defined in: packages/core/src/session/session.ts:122

OAuth client the bearer token was issued to

Inherited from​

Session.clientId


identUsed​

identUsed: string

Defined in: packages/core/src/session/session.ts:70

Ident used

Inherited from​

Session.identUsed


mfa?​

optional mfa?: MfaState

Defined in: packages/core/src/session/session.ts:94

MFA state of the session

Inherited from​

Session.mfa


mfaAt?​

optional mfaAt?: 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​

Session.mfaAt


mfaVerifications?​

optional mfaVerifications?: Record<string, MfaVerification>

Defined in: packages/core/src/session/session.ts:100

Inherited from​

Session.mfaVerifications


provider?​

optional provider?: string

Defined in: packages/core/src/session/session.ts:80

Authentication provider used

Inherited from​

Session.provider


refreshFamily?​

optional refreshFamily?: string

Defined in: packages/core/src/session/session.ts:105

Refresh token family identifier

Inherited from​

Session.refreshFamily


roles​

roles: string[]

Defined in: packages/core/src/session/session.ts:75

User current roles

Inherited from​

Session.roles


scopes?​

optional scopes?: 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​

Session.scopes


stateless?​

optional stateless?: boolean

Defined in: packages/core/src/session/session.ts:135

Session is stateless (not persisted in cookies)

Inherited from​

Session.stateless


transientAmr?​

optional transientAmr?: string[]

Defined in: packages/core/src/session/session.ts:89

Authentication methods verified only for this request

Inherited from​

Session.transientAmr


userId?​

optional userId?: string

Defined in: packages/core/src/session/session.ts:66

User id

Inherited from​

Session.userId


uuid​

uuid: string

Defined in: packages/core/src/session/session.ts:62

Session uuid

Inherited from​

Session.uuid

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​

Session.addTransientAmr


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​

Session.getPersistentAmr


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​

Session.getProxy


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​

Session.isApplication


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​

Session.isDirty


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​

Session.isLogged


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​

Session.isPending


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​

Session.login


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​

ApplicationIdentity

the application identity

options?​

authentication methods, ["oidc"] by default

amr?​

string[]

authentication methods used

Returns​

void

Inherited from​

Session.loginApplication


logout()​

logout(): void

Defined in: packages/core/src/session/session.ts:183

Logout

Returns​

void

Inherited from​

Session.logout


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​

Session.markMfaVerified


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

Inherited from​

Session.mfaAge