If you want to know the details of the current session (which also gives the user name) then the REST API URI path is /rest/auth/latest/session
Below is the JSON returned by the API
{
"self": "<JIRA host>/rest/api/latest/user?username=bob",
"name": "Bob",
"loginInfo": {
"failedLoginCount": 1,
"loginCount": 2,
"lastFailedLoginTime": "2011-11-17T19:27:50.097-0800",
"previousLoginTime": "2011-11-20T19:06:58.412-0800"
}
}