Skip to content

Session

CI edited this page Apr 2, 2019 · 4 revisions

Description

A session is a period of information interchange between an authenticated identity and DataPeps.

A user establishes a session by logging in to the DataPeps service. After establishing a session an identity can send authenticated requests to the service and use the SDK functions.

Sessions have validity period. A session is renewed automatically. The user should log out by closing the session after finishing working with DataPeps.

Session establishment

An identity logs in to DataPeps with the use of the identity's login and secret:

let aliceSession = await sdk.login("alice", "aliceP@ssw0rd")

An identity can then establish a new session for any identity from the access group:

let aliceSecondSession = await aliceSession.createSession("aliceSecond")

In this way an identity for which no secret was specified during its creation can log in.

Logging out

An identity closes the session like this:

await aliceSession.close();

Examples

Session establishment — an identity logs in and out.