PLCnext API Documentation 23.6.0.37
|
UserManager Service to retrieve and set session properties like sessionId and extended session informations More...
#include <ISessionService.hpp>
Public Types | |
using | Ptr = std::shared_ptr< ISessionService > |
![]() | |
typedef std::shared_ptr< IRscService > | Ptr |
Public Member Functions | |
ISessionService (void)=default | |
Constructs an ISessionService instance. | |
virtual boolean | GetSessionId (SecurityToken securityToken, RscString< 128 > &sessionId)=0 |
Gets a sessionId (strong security Token) for a UserManager(UM) session, represented by its Ade.CommonRemoting.Security.SecurityToken This is an alternative way to refer to the same session. Note: This method must not be called remotely via the RSC-Gateway and will throw an exception if attempted. More... | |
virtual boolean | GetSecurityTokenFromSessionId (const RscString< 128 > &sessionId, SecurityToken &securityToken)=0 |
Searchs for a UserManager(UM) Session identified by a StrongSecurityToken. If a valid session was found, the UM securityToken is returned in parameter securityToken Note: This method must not be called remotely via the RSC-Gateway and will throw an exception if attempted. More... | |
virtual boolean | GetSessionProperty (SecurityToken securityToken, const RscString< 128 > &key, RscString< 128 > &value)=0 |
Read a named property from a UserManager(UM) session. A property is extended information bound to a UM session identified by a key. Example: the user which opened the session. Note: This method must not be called remotely via the RSC-Gateway and will throw an exception if attempted. More... | |
virtual boolean | SetSessionProperty (SecurityToken securityToken, const RscString< 128 > &key, const RscString< 128 > &value)=0 |
Sets a named property for a Um session. A property is extended information bound to a um session identified by a key. If a property was already set, further calls with the same key will override it. Note: This method must not be called remotely via the RSC-Gateway and will throw an exception if attempted. More... | |
virtual boolean | DeleteSessionProperty (SecurityToken securityToken, const RscString< 128 > &key)=0 |
Deletes a named property for a Um session. Note: This method must not be called remotely via the RSC-Gateway and will throw an exception if attempted. More... | |
virtual boolean | IsSessionActive (SecurityToken securityToken)=0 |
Check if the um session is active or not. Note: This method must not be called remotely via the RSC-Gateway and will throw an exception if attempted. More... | |
![]() | |
IRscService (void)=default | |
Constructs an IRscService instance. | |
virtual | ~IRscService (void)=default |
Destructs this instance and frees all resouces. | |
Static Public Member Functions | |
static IRscServiceProxyFactory & | GetProxyFactory (void) |
![]() | |
static IRscServiceProxyFactory & | GetProxyFactory (void) |
Returns a reference to service proxy factory to create a proxy instance of the service More... | |
UserManager Service to retrieve and set session properties like sessionId and extended session informations
This service is only usable from the SDK for other processes running on the PLC; it is not intended for public use over the RSC-Gateway.
All code snippets are written for C++. SessionId and SecurityToken are semantically equivalent; However the SecurityToken is primarily intended for internal use, while the SessionId is a randomised string, which is harder to brute-force and should be preferred for all external applications like web based authentication. SessionProperties are used to add information to a session. Ex. the UserManager will add a property with the key "username" by default. In order to prevent overrides, external applications should prepend "Custom." to their own property-keys.
This service is defined in library Arp.System.Um.
Realtime Usage: This API call does not have to be deterministic in runtime behaviour, so an asynchronous execution should be considered.
|
pure virtual |
Deletes a named property for a Um session.
Note: This method must not be called remotely via the RSC-Gateway and will throw an exception if attempted.
securityToken | the um securityToken identifying the session |
key | key identifying the extended info which should be deleted |
Example:
|
pure virtual |
Searchs for a UserManager(UM) Session identified by a StrongSecurityToken. If a valid session was found, the UM securityToken is returned in parameter securityToken
Note: This method must not be called remotely via the RSC-Gateway and will throw an exception if attempted.
sessionId | The strong sessionId to search for |
securityToken | returns the Ade.CommonRemoting.Security.SecurityToken for the Um session |
false
if the strongSecurityToken is not valid, true
otherwiseExample:
|
pure virtual |
Gets a sessionId (strong security Token) for a UserManager(UM) session, represented by its Ade.CommonRemoting.Security.SecurityToken
This is an alternative way to refer to the same session. Note: This method must not be called remotely via the RSC-Gateway and will throw an exception if attempted.
securityToken | Ade.CommonRemoting.Security.SecurityToken identifying the session |
sessionId | returns the strongToken, only valid if true is returned, Should be ignored otherwise |
false
if the securityToken is not valid (session expired or has never existed), true
otherwise.Example:
|
pure virtual |
Read a named property from a UserManager(UM) session. A property is extended information bound to a UM session identified by a key. Example: the user which opened the session.
Note: This method must not be called remotely via the RSC-Gateway and will throw an exception if attempted.
securityToken | the Ade.CommonRemoting.Security.SecurityTokenidentifying the session |
key | key identifying the extended info |
value | value of the session information identifying by key |
true
if the SecurityToken is valid and the Sessionproperty was set, false
otherwise Example:
|
pure virtual |
Check if the um session is active or not.
Note: This method must not be called remotely via the RSC-Gateway and will throw an exception if attempted.
securityToken | Security token of the session to be checked |
true
if the session is active, false
otherwise
|
pure virtual |
Sets a named property for a Um session. A property is extended information bound to a um session identified by a key. If a property was already set, further calls with the same key will override it.
Note: This method must not be called remotely via the RSC-Gateway and will throw an exception if attempted.
securityToken | the Ade.CommonRemoting.Security.SecurityToken identifying the session |
key | key identifying the extended info |
value | value to set as extended info for the um session |
false
if the securityToken is not valid, true
if securityToken is valid.Example: