User Login Manager#
Introduction#
The User Login Manager API provided by ScanHub is specifically designed to manage user authentication and authorization within the system. It plays a crucial role in creating, updating, retrieving, and deleting user login sessions, as well as handling the uploading of results related to specific records. The key endpoints in this API are:
Web API#
- GET /api/v1/userlogin/getcurrentuser#
Get Current User
Get current user from access_token. May be called as an endpoint or used in FastAPI with Depends.
Parameters#
- access_token
User token as previously obtained trough a call to /login Submit via HTTP header “Authorization: Bearer <access_token>”
Returns#
User pydantic model, the user data of the current user.
Raises#
- HTTPException
401: Unauthorized if the token is invalid or outdated.
- status 200:
Successful Response
- POST /api/v1/userlogin/loginfromcookie#
Loginfromcookie
Login endpoint for login with cookie.
Parameters#
- access_token
User token as previously obtained trough a call to /login Submit via HTTP cookie.
Returns#
User pydantic model, the user data in case of a successful login.
Raises#
- HTTPException
401: Unauthorized if the username or password is wrong.
- status 200:
Successful Response
- status 422:
Validation Error
- POST /api/v1/userlogin/login#
Login
Login endpoint.
Parameters#
- form_data
Http form data for OAuth2 compliant login with username and password.
Returns#
User pydantic model, the user data in case of a successful login.
Raises#
- HTTPException
401: Unauthorized if the username or password is wrong.
- status 200:
Successful Response
- status 422:
Validation Error
- GET /api/v1/userlogin/getallusers#
Get User List
Get all users endpoint (only admins).
Returns#
List of all users. The access_token and token_type properties are set to “” for all of them.
- status 200:
Successful Response
- GET /api/v1/userlogin/checknousers#
Check No Users
Check if there are no users in the database.
Returns#
True, if there are no users in the database.
- status 200:
Successful Response
- POST /api/v1/userlogin/createuser#
Create User
Create user database entry (only admins).
Parameters#
- new_user
pydantic base model of new user, token_type should be “password” and access_token should contain the password of the new user. The password of the new user should at least be 12 characters long.
- status 201:
Successful Response
- status 422:
Validation Error
- POST /api/v1/userlogin/createfirstuser#
Create First User
Create first user.
Parameters#
- first_user
pydantic base model of the first user, token_type should be “password” and access_token should contain the password of the new user. The password of the new user should at least be 12 characters long. The role should be admin.
- status 201:
Successful Response
- status 422:
Validation Error
- DELETE /api/v1/userlogin/deleteuser#
User Delete
Delete an existing user (requires admin priviledges).
Parameters#
- username_to_delete
Name of the user to delete.
Raises#
- HTTPException
404: Not found
- query string username_to_delete:
(Required)
- status 204:
Successful Response
- status 422:
Validation Error
- PUT /api/v1/userlogin/updateuser#
Update User
Update the first_name, last_name, email and role of an existing user.
Parameters#
- updated_user
The attribute username identifies the user to modify. The attributes first_name, last_name, email and role are set for this user.
Returns#
None
Raises#
- HTTPException
404: Not found if user not found.
- status 200:
Successful Response
- status 422:
Validation Error
- PUT /api/v1/userlogin/changepassword#
Change Password
Change password of a user. Only administrators may change passwords of other users.
Parameters#
- password_update_request
.password_of_requester: the password of the requester .username_to_change_password_for: the username for whom to change the password .newpassword: the new password
Returns#
None
Raises#
- HTTPException
400: New Password must have at least 12 characters. Old Password must be correct.
- status 200:
Successful Response
- status 422:
Validation Error
License#
User Login Manager, including all its source code and associated documentation (collectively, the “Software”), is dual-licensed under the GNU General Public License version 3 (GPLv3) and the ScanHub commercial license.
Open Source License#
If you want to use the Software under the terms of the GPLv3, you may do so for free. Under the GPLv3, you are allowed to modify and distribute the Software, but any derivative works that you distribute must also be licensed under the GPLv3. For the precise terms and conditions, please refer to the text of the GPLv3, which is included with the Software and can also be found at: http://www.gnu.org/licenses/gpl-3.0.html
Commercial License#
If you wish to use the Software without the restrictions of the GPLv3, such as for the purpose of developing proprietary software that includes the Software without the obligation to disclose your source code, you may purchase a commercial license from BRAIN-LINK UG (haftungsbeschränkt).
The commercial license grants you, the licensee, the rights to use, modify, and distribute the Software without the requirement of providing the source code of your proprietary software to the end users. The commercial license also includes access to premium support and services.
For more information on the commercial license, including pricing, please contact us at info@brain-link.de.
Choice of License#
You may choose to use the Software under either the GPLv3 or the commercial license. If you choose to use the Software under the GPLv3, you must comply with all of the terms of the GPLv3. If you choose to use the Software under the commercial license, you must comply with all of the terms of the commercial license.
Disclaimer#
This is not a legal document. The exact terms of the GPLv3 and the commercial license are specified in their respective legal texts. This document is merely intended to provide a general overview of the dual licensing scheme.