Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches

◆ createSession()

std::optional< SessionPrx > Glacier2::RouterPrx::createSession ( std::string_view userId,
std::string_view password,
const Ice::Context & context = Ice::noExplicitContext ) const

Creates a session for the client (caller) with the router.

If a Glacier2::SessionManagerPrx is configured, a proxy to a Glacier2::SessionPrx object is returned to the client. Otherwise, null is returned and only an internal session (i.e., not visible to the client) is created. If a non-null session proxy is returned, it must be configured to route through the router that created it. This occurs automatically when the router is configured as the client's default router at the time the session proxy is created in the client application; otherwise, the client must configure the session proxy explicitly.

Parameters
userIdThe user ID.
passwordThe password.
contextThe request context.
Returns
A proxy for the newly created session, or null if no Glacier2::SessionManagerPrx is configured.
Exceptions
Glacier2::CannotCreateSessionExceptionThrown when the session cannot be created.
Glacier2::PermissionDeniedExceptionThrown when an authentication or authorization failure occurs.
See also
Session
SessionManager
PermissionsVerifier