REST API reference
Purpose
There are multiple native and non-native apps from the Jira and Confluence product range that are available for smartphones and can be downloaded via the App Store or Play Store. However, those apps do not include a two-factor authentication for the login process. In order to implement this functionality in their apps, mobile app vendors have requested an API to support the second factor (which Secure Login provides) in their apps. To enable a two-factor authentication with Secure Login, the Secure Login API provided by syracom offers a set of necessary endpoints that allow an app to authenticate a second factor.
Overview
This authentication is linked with an HTTP session, which means that all of the apps requests must be done within the same session. In case the session has expired or was invalidated, the user has to do a new authentication. As all requests to the API must be authorized by the server, the API takes the username from the current HTTP session. The URL of the API depends on your installation, but generally follows the schema:
https://<baseURL>/<contextPath>/rest/securelogin−admin/1.0/api/<endpoint>
So, for example, if you use Jira at my.shiny.server on port 2048 with the context path /jira, then the URL of the /info endpoint is:
https://my.shiny.server:2048/jira/rest/securelogin−admin/1.0/api/info
The API contains three endpoints:
endpoint | description |
---|---|
/info | Provides general information about Secure Login. |
/user | Provides information about the current state of the user. |
/auth | Authenticates the user of the current HTTP session. |
The usual call flow will first call /info to make sure the plugin is active and ready to work.
If the plugin is inactive, nothing else needs to be done and the app proceeds. It is recommended to check from time to time if the plugin got activated.
If the plugin is active, the app compares the timestamp that came with the response to see if there are any time drifts to consider.
The next call goes to /user, which delivers information about the users status from the perspective of Secure Login.
The returned data indicates whether the user:
has to enter his or her PIN or
has to do the onboarding process or
is blocked (information about the reason for and duration of the block are provided)
If the user has to enter his or her PIN, then the next call will go to the endpoint /auth, which submits the PIN. On a correct PIN, Secure Login will validate the current HTTP session, and the user is authenticated.
Attention: If the app is installed on a phone that changes between different IP networks (for example if you connect to a different WiFi), then use the /info endpoint to check whether the user has to (re-)enter the PIN or is still authenticated.
What if the user enters a wrong PIN?
After having entered a wrong PIN, the user can retry to enter the PIN as long as he or she has not been blocked. How many retries the user has until being blocked depends on the settings the administrator made.
The administrator can specify
after how many incorrect PINs the user is blocked and
for how long the user is blocked.
For more information, see the Administrator's Guide.
Resources
api/info
api/user
api/auth