arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

getUserLogin

Get the current logged in user.

circle-check

There is no login or logout API in Cortex. Instead, users are required to login through the EMOTIV Launcherarrow-up-right.

hashtag
Parameters

This method has no parameter.

hashtag
Result

The result is an array of objects, each object describes a logged in user. If no user is logged in, then the result is an empty array.

Please note that currently, Cortex is a single user system. Only one user can login at a time, so the result contains at most one object.

The user object includes these fields:

If currentOSUId is equal to loggedInOSUId, then the user is already logged in and can work with Cortex. If currentOSUId is different from loggedInOSUId, then a user is logged into Cortex, but from a different OS account. So the user of the current OS account cannot work with Cortex, and must check EMOTIV Launcher.

hashtag
Examples

hashtag
No user is logged in

hashtag
A user is logged in from the current OS account

hashtag
A user is logged in from another OS account

The application is connected to Cortex that belongs to the OS account 501/jsnow. But someone has already logged in to Cortex from OS account 502/astark with the EmotivID aria.stark. So, the application cannot work with Cortex.

The id of the OS account used to login in EMOTIV Launcher

loggedInOSUsername

string

The user name for loggedInOSUId

lastLoginTime

string (ISO datetime)

When this user logged in for the last time.

This field was added in Cortex 2.3.0

Name

Type

Description

username

string

The EmotivID of the user

currentOSUId

string

The id of the current OS account

currentOSUsername

string

The user name for currentOSUId

loggedInOSUId

string

{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "getUserLogin"
}
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": []
}
{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "getUserLogin"
}
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [{
        "currentOSUId":"501",
        "currentOSUsername":"jsnow",
        "lastLoginTime": "2019-11-28T12:09:17.300+07:00",
        "loggedInOSUId":"501",
        "loggedInOSUsername":"jsnow",
        "username":"jon.snow"
    }]
}
{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "getUserLogin"
}
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": [{
        "currentOSUId":"501",
        "currentOSUsername":"jsnow",
        "lastLoginTime": "2019-11-28T12:09:17.300+07:00",
        "loggedInOSUId":"502",
        "loggedInOSUsername":"astark",
        "username":"aria.stark"
    }]
}