Create Gitlab_selfhosted authored by Jacob Benz's avatar Jacob Benz
One additional feature of this fork of LEAF-Writer compared to the upstream version is not only the support of GitLab as an authorization and file storage platform but to also support on-premise self-hosted instances of GitLab. To enable this, a [Keycloak plugin](https://code.fbi.h-da.de/leaf-writer-x/dependencies/keycloak-gitlabselfhosted) has been developed.
This Keycloak plugin is necessary for two reasons:
1. Keycloak has already a plugin to support GitLab as an identity provider similar to GitHub but this works only with the official gitlab.com-instance. The API between self-managed instances and the official one is identical but obviously a different server has to be called. Our plugin enables this by introducing a field where the URL for the self-hosted GitLab instance can be specified. This URL can even point to the official GitLab instance.
2. Unlike GitHub, access tokens for GitLab instances are only valid for 2 hours. Our Keycloak plugin has a mechanism implemented to renew them if necessary. This mechanism, however, is not perfect.
The Kecycloak plugin for self-hosted GitLab instances is based on [this plugin for Discord](https://github.com/wadahiro/keycloak-discord/releases) while using the specific logic as found in the GitLab plugin that is part of Keycloak. The token renewal mechanism has been taken from [here](https://gist.github.com/Dreneg/83e0f966eeeaf065e70ba298830d8bce).
\ No newline at end of file