Overview

Documents the security and user management features.

Details

The security service provides authentication, authorization, and logout services. A user timeout also supported so users do not remained logged in indefinitely. The default timeout is set to 2 hours and can be easily changed. All REST services are secured by the use of an authorization token that is obtained from the security service and passed to other calls.  For a truly secured environment, it is recommended that the system be run under HTTPS instead of HTTP. Otherwise usernames, passwords, and authorization tokens will be passed in plain text with HTTP requests.

When a user authenticates, an authToken (a random UUID) is passed back to the client which can be used on subsequent calls to the server.  This authToken is checked against a map of valid tokens and can be used to identify the user who was assigned this token.   The time of an authentication request is recorded by the authToken so that it can be determined when the last request with this token was made.  If upon checking an authToken the last request was longer ago than the "ihtsdo.security.timeout" setting, then the authorization is rejected and the user is redirected to log in again.

Restarting the server clears all authTokens and users must re-authenticate. The application will redirect users to the login page if their authToken is no longer valid (either because of inactivity timeout or server restart).

The sequence of events looks like this

 

User Management

While authentication of users is offloaded to the IHTSDO user management services, there is some user management within the application itself.    The system comes with a few "stock" users that never require authentication and are used to track the output of certain admin tasks.  These users are

For any other user that authenticates normally, a local application user object is created with a default "VIEWER" application role.  If the user already exists, the name and email address are requested from the user management service and are updated so the application tracking of user info is always kept up-to-date.

Once a "map user" exists, that user can be assigned as a specialist or lead or administrator on a particular project.  Any user not specifically assigned to a project is considered a VIEWER.   VIEWERS do not have access to private (e.g. "non public") projects at all. 

User Roles

The system make use of "application roles" and "map-project-specific roles".  There are 4 roles:

Each REST call not only verifies the authToken is valid but also authorizes the user's role against the task being attempted.  Read-only services generally only require VIEWER role where as things like map project creation and metadata editing require ADMINISTRATOR role.   Any REST service that takes a map project or map project id requires a 'map-project-specific role' by that user on that project.  See REST documentation for more details.

An admin tool exists to create a user with an application role of ADMINISTRATOR, and if needed an empty project to bootstrapp the rest of application configuration.  See Admin Tools for more info.

Configuration

The following configuration settings affect security.

Property
Default Value
Notes

ihtsdo.security.activated

 

trueIndicates whether security is enabled or disabled. UAT and dev environments have security disabled by default. When security is disabled, an authorization token matching the username is used.

NOTE: even when security is disabled, a user must still login but any password will authenticate any user. 
ihtsdo.security.urlhttps://usermanagement.ihtsdotools.org/security-web/query/

The URL of the IHTSDO user management server.

NOTE: Only IHTSDO security is supported. Ideally, this would be made more general in the future to support injection of a handler to support security.

ihtsdo.security.timeout

7200000Inactivity timeout, in milliseconds.

References/Links