Class: Session

Session

new Session()

Session Implement a REST resource for acquiring a session cookie.

Properties:
Name Type Description
connector IConnector

the jira connector instance

Source:

Methods

currentUser(options, callbackopt) → {Promise.<any>}

Returns information about the currently authenticated user's session. If the caller is not authenticated they will get a 401 Unauthorized status code.

Parameters:
Name Type Attributes Description
options Object

An object containing options to pass to the Jira API.

Properties
Name Type Description
token string

token The token to use for authentication. This token is supplied on a sucessful login. If not supplied, the default token (if set) is used

callback <optional>

if supplied, called with result of api call

Source:
Returns:

result of api call

Type
Promise.<any>

login(options, callbackopt) → {Promise.<any>}

Creates a new session for a user in JIRA. Once a session has been successfully created it can be used to access

* any of JIRA's remote APIs and also the web UI by passing the appropriate HTTP Cookie header.
*
* Note that it is generally preferrable to use HTTP BASIC authentication with the REST API. However, this resource
* may be used to mimic the behaviour of JIRA's log-in page (e.g. to display log-in errors to a user).
* Note that the response contains the Set-Cookie HTTP headers that must be honoured by the
* caller. If you are using a cookie-aware HTTP client then it will handle all Set-Cookie headers
* automatically. This is important because setting the JSESSIONID cookie alone may not be
* sufficient for the authentication to work.Schema{"id":"https://docs.atlassian.com/jira/REST/schema/auth-success#","title":"Auth Success","type":"object","properties":{"session":{"title":"Session Info","type":"object","properties":{"name":{"type":"string"},"value":{"type":"string"}},"additionalProperties":false},"loginInfo":{"title":"Login Info","type":"object","properties":{"failedLoginCount":{"type":"integer"},"loginCount":{"type":"integer"},"lastFailedLoginTime":{"type":"string"},"previousLoginTime":{"type":"string"}},"additionalProperties":false}},"additionalProperties":false}
Parameters:
Name Type Attributes Description
options Object

An object containing options to pass to the Jira API.

Properties
Name Type Description
username string

username

password string

password

callback <optional>

if supplied, called with result of api call

Source:
Returns:

result of api call

Type
Promise.<any>

logout(options, callbackopt) → {Promise.<any>}

Logs the current user out of JIRA, destroying the existing session, if any.

Parameters:
Name Type Attributes Description
options Object

An object containing options to pass to the Jira API.

Properties
Name Type Description
token string

token The token to use for authentication. This token is supplied on a sucessful login. If not supplied, the default token (if set) is used

callback <optional>

if supplied, called with result of api call

Source:
Returns:

result of api call

Type
Promise.<any>