Learning
Documentation
Community
Open Exchange
Global Masters
Home / Class Reference / %SYS namespace / OAuth2.Server.Session
Private  Storage   

OAuth2.Server.Session


persistent class OAuth2.Server.Session extends
%Persistent

The OAuth2.Server.Session class is the default SessionClass which is included with the server. The default class will use httpOnly cookies to maintain the session.
The SessionClass is specified in the Authorization Server Configuration. The SessionClass must contain GetUser, Update, Login and Logout methods with signatures as specified in this class.

Inventory


Parameters Properties Methods Queries Indices ForeignKeys Triggers
1 5 11 3


Summary


Properties
%Concurrency AuthTime Cookie Expires Scope
Username

Methods
%%OIDGet %1Check %AddJrnObjToSyncSet %AddToSaveSet
%AddToSyncSet %BMEBuilt %BindExport %BuildIndices
%BuildIndicesAsync %BuildIndicesAsyncResponse %BuildIndicesSegment %BuildObjectGraph
%CheckConstraints %CheckConstraintsForExtent %ClassIsLatestVersion %ClassName
%Close %ComposeOid %ConstructClone %Delete
%DeleteExtent %DeleteId %DispatchClassMethod %DispatchGetModified
%DispatchGetProperty %DispatchMethod %DispatchSetModified %DispatchSetMultidimProperty
%DispatchSetProperty %DowngradeConcurrency %ExecuteAfterTriggers %ExecuteBeforeTriggers
%Exists %ExistsId %Extends %FileIndices
%FileIndicesBuffered %GUID %GUIDSet %GetLock
%GetParameter %GetSwizzleObject %Id %IncrementCount
%InsertBatch %IsA %IsModified %IsNull
%JournalObject %KillExtent %KillExtentData %LoadFromMemory
%LockExtent %LockId %New %NormalizeObject
%ObjectIsNull %ObjectModified %Oid %OnBeforeAddToSync
%OnDetermineClass %Open %OpenId %OriginalNamespace
%PackageName %PhysicalAddress %PurgeIndices %Reload
%RemoveFromSaveSet %ResolveConcurrencyConflict %RollBack %SQLAcquireLock
%SQLAcquireTableLock %SQLAfterTriggers %SQLBeforeTriggers %SQLBuildIndices
%SQLBuildPurgeIndexForRow %SQLBuildPurgeIndices %SQLCheckUnique %SQLCheckUniqueIndices
%SQLCheckUniqueKeys %SQLCopyIcolIntoName %SQLCopyNameIntoIcol %SQLCreateInsDelTables
%SQLDefineiDjVars %SQLDelete %SQLDeleteChildren %SQLDeleteTempStreams
%SQLEExit %SQLExists %SQLFKeyDelLock %SQLFastInsert
%SQLFieldValidate %SQLGetLock %SQLGetOld %SQLGetOldAll
%SQLGetOldIndex %SQLInsert %SQLInsertComputes %SQLInsertStreams
%SQLInvalid %SQLInvalid2 %SQLMVDelete %SQLMVIndexDelete
%SQLMVIndexInsert %SQLMVIndexUpdate %SQLMVInsert %SQLMVUpdate
%SQLMissing %SQLNormalizeCompFields %SQLNormalizeFields %SQLPurgeIndices
%SQLQuickBulkInsert %SQLQuickBulkLoad %SQLQuickBulkSave %SQLQuickBulkUpdate
%SQLQuickDelete %SQLQuickDeleteChildren %SQLQuickFindPKeyByRowID %SQLQuickFindRowIDByPKey
%SQLQuickInsert %SQLQuickLoad %SQLQuickLoadChildren %SQLQuickLogicalToOdbc
%SQLQuickOdbcToLogical %SQLQuickUpdate %SQLReleaseLock %SQLReleaseTableLock
%SQLStorageValidation %SQLTrigDelTab %SQLTrigInsTab %SQLUnlock
%SQLUnlock2 %SQLUnlockError %SQLUnlockRef %SQLUpdate
%SQLUpdateComputes %SQLUpdateStreams %SQLValidateCompFields %SQLValidateFields
%SQLicompView %SQLnBuild %Save %SaveDirect
%SaveIndices %SerializeObject %SetModified %SortBegin
%SortEnd %SyncObjectIn %SyncTransport %UnlockExtent
%UnlockId %UpgradeConcurrency %ValidateIndices %ValidateObject
Delete GetCookie GetCurrentSession GetUser
Login Logout MakeCookieValue OpenByCookie
SetCookie Update


Parameters


• parameter COOKIENAME = "CSPOAuth2Session";
The name of the cookie used to maintain the session

Properties


• property AuthTime as %Integer;
The time when the user was authenticated.
• property Cookie as %String(COLLATION="EXACT",MAXLEN=128) [ Required ];
Cookie that is used to track the session.
• property Expires as %Integer;
Expires is the time in seconds from beginning of the Unix epoch when the session expires. If Expires="", then session does not expire.
• property Scope as %String(MAXLEN=1024);
Scope is the blank separated list of scopes permitted for this user in this session.
• property Username as %String(COLLATION="EXACT");
User that is logged in by this session.

Methods


• private classmethod Cleanup()
Clean up all expired sessions
• method Delete() as %Status
Delete this session object
• classmethod GetCookie() as %String
An overridable method to obtain the cookie. This allows easy change of the cookie format.
• classmethod GetCurrentSession(Output sc As %Status) as OAuth2.Server.Session
The GetCurrentSession method returns the currently logged in session. If no session exists, then "" is returned.
• classmethod GetUser(Output scope As %String, authTime As %Integer, Output sc As %Status) as %String
The GetUser method returns the name of the user currently logged into this session. If no session exists, then "" is returned.
• classmethod Login(username As %String, scope As %String, interval As %Integer, Output authTime As %Integer) as %Status
The Login method creates a new session for the user named by username.
The scope argument specifies a blank separated list of scopes that this user is authorized for. The interval argument is seconds until expiration for the session. If interval=0, then the session will not expire.
• classmethod Logout()
The Logout method terminates the current session. It is not considered an error to have no current session.
• classmethod MakeCookieValue() as %String
An overridable method to create a new cookie value. This allows easy change of the cookie format.
• classmethod OpenByCookie(cookie As %String, Output sc As %Status) as OAuth2.Server.Session
Open the OAuth2.Server.Session instance using Cookie.
• classmethod SetCookie(value As %String, expires As %Integer)
Set the cookie.
• classmethod Update(scope As %String, interval As %Integer) as %Status
The Update method updates the existing current session. The blank separated list of scopes in the scope argument updates the scopes associated with the session. If the interval argument is specified the session interval is updated. The interval argument is seconds until expiration for the session. If interval=0, then the session will not expire.

Indices


•index (CookieIndex on Cookie) [IdKey,Unique];
The IDKEY for the session class.
•index (ExpiresIndex on Expires);
Order by time
•index (UserIndex on Username);
The session is indexed by the Username