blankogmbh / kirby-gitlab-oauth2
Requires
- getkirby/kirby: ^2.5
- omines/oauth2-gitlab: ^3.0
This package is auto-updated.
Last update: 2019-05-13 07:36:05 UTC
README
This is a plugin for Kirby that allows you to login using your GitLab Account.
Usage
Go to yourdomain.com/gitlab-login
and you go through the GitLab Authentication process and are loggedin to the panel.
Installation
Composer
If you installed kirby via composer open your projects composer.json and add
blankogmbh/kirby-gitlab-oauth2
as a requirement and a custom path so it will be installed into the site/plugins-Folder and run composer install
.
Thats what your composer.json will look like afterwards:
{ "name": "your-company/your-project", "require": { "mnsami/composer-custom-directory-installer": "1.1.*", "getkirby/kirby": "^2.5", "getkirby/panel": "^2.5", "blankogmbh/kirby-gitlab-oauth2": "1.*" }, "extra": { "installer-paths": { "./kirby": ["getkirby/kirby"], "./kirby/toolkit": ["getkirby/toolkit"], "./panel": ["getkirby/panel"], "./site/plugins/gitlab-oauth2": ["blankogmbh/kirby-gitlab-oauth2"] } } }
Add the following to your site/config/config.php
(get the App-ID and Secret):
c::set('gitlab-oauth2', true); c::set('gitlab-oauth2-clientId', 'your-app-id'); c::set('gitlab-oauth2-clientSecret', 'your-secret'); // if you have a self-hosted gitlab, add your custom url here: c::set('gitlab-oauth2-domain', 'https://git.yourdomain.com');
There are three ways you can allow users to login, by Username, UserId or Domain of the e-mail address:
c::set('gitlab-oauth2-allowedUsernames', [ 'pascalmh', 'markusdenhoff', ]); c::set('gitlab-oauth2-allowedUserIds', [ 123, 456, ]); c::set('gitlab-oauth2-allowedDomains', [ 'blanko.de', // this would allow anyone@blanko.de to login 'blanko.biz', // this would allow anyone@blanko.biz to login ]);
Author
Pascal 'Pascalmh' Küsgen http://pascalmh.de