new UBSession() protected
Internal class, returned as a result of
UBConnection.authorize()
The main method is UBSession.signature()
Developer never create this class directly.
Members
userData: Object
protected
readonly
Contain custom user data. Usually filled inside server onUserLogon
event handlers
Do not use it directly, instead use helper method UBConnection.userData() instead.
authSchema: String
protected
readonly
Name of authentication schema
Methods
signature() → string
Session signature for authorized request. Can be added as LAST parameter in url, or to Authorization header (preferred way)
$App.connection.authorize().then(function(session){
// for URL
return 'session_signature=' + session.signature()
//for header
return {Authorization: session.authSchema + ' ' + session.signature()}
});
isAnonymous() → boolean
Current session is anonymous session
authHeader() → string
Return authorization header
$App.connection.authorize().then(function(session){
return {Authorization: session.authHeader()}
});
hexa8(value) → String
Return hexadecimal string of 8 character length from value
Arguments:
crc32(s, polynomialopt, initialValueopt, finalXORValueopt) → Number
Calculate CRC32 checksum for string
Arguments:
-
s
(String)
 string to calculate CRC32
-
[polynomial]
(Number)
 polynomial basis. default to 0x04C11DB7
-
[initialValue]
(Number)
 initial crc value. default to 0xFFFFFFFF
-
[finalXORValue]
(Number)
 default to 0xFFFFFFFF
onUserLogon
event handlers
Do not use it directly, instead use helper method UBConnection.userData() instead.
signature() → string
Session signature for authorized request. Can be added as LAST parameter in url, or to Authorization header (preferred way)
$App.connection.authorize().then(function(session){
// for URL
return 'session_signature=' + session.signature()
//for header
return {Authorization: session.authSchema + ' ' + session.signature()}
});
isAnonymous() → boolean
Current session is anonymous session
authHeader() → string
Return authorization header
$App.connection.authorize().then(function(session){
return {Authorization: session.authHeader()}
});
hexa8(value) → String
Return hexadecimal string of 8 character length from value
Arguments:
crc32(s, polynomialopt, initialValueopt, finalXORValueopt) → Number
Calculate CRC32 checksum for string
Arguments:
-
s
(String)
 string to calculate CRC32 -
[polynomial]
(Number)
 polynomial basis. default to 0x04C11DB7 -
[initialValue]
(Number)
 initial crc value. default to 0xFFFFFFFF -
[finalXORValue]
(Number)
 default to 0xFFFFFFFF