Skip to main content

Authentication

Authentication is the entry point into the API.

The login method is used to retrieve an authentication key (auth-key) through a user ID and password. This key is then valid and can be used for the whole duration of the user session and is used to identify the user during subsequent API calls.

You can also create permanent API keys in user settings.

Usage

For HTTP calls, the key is passed in the X-BM-ApiKey header.

For Java calls, the key is used to create a service-provider to create api instances. For example:

IServiceProvider serviceProvider = ClientSideServiceProvider.getProvider(server, resp.authKey);

https://pkg.bluemind.net/apidoc/openui-models/web-resources/?bm_version=4.9.2940#!/net.bluemind.authentication.api.IAuthentication/post_auth_login :

HTTP example

  • Method : POST
  • URL : https://<domain.lan>/api/auth/login?login=<user identifier>
  • BODY : "password

Curl example

curl -X POST -k --header 'Content-Type: application/json' --header 'Accept: application/json' -d '"password"' 'https://<domaine>/api/auth/login?login=<login@domain>'

Example in Java (using the BlueMind generated client)

String serverUrl = "https://<domain>";
LoginResponse resp = ClientSideServiceProvider.getProvider(serverUrl, null).instance(IAuthentication.class).login(<login>, <password>, "");
IServiceProvider serviceProvider = ClientSideServiceProvider.getProvider(server, resp.authKey);