yapi-plugin-gitlab-oauth2

1.0.0 • Public • Published

yapi-plugin-gitlab-oauth2

基于Oauth2的Gitlab登陆插件,配置方式如下:

第一步: 在生成的配置文件config.json中加入如下配置:

"plugins":[{
	"name":"gitlab-oauth2",
	"options":{
		"host" : "http://example.gitlab.com.cn",
		"clientId" : "",
		"clientSecret" : "",
		"redirectUri" : "http://example.yapi.com.cn/api/user/login_by_token"
	}
}]

plugins配置说明如下

参数 说明
host Gitlab地址
clientId Gitlab clientId,在Gitlab admin area->Applications中获取
clientSecret Gitlab clientSecret,获取同上
redirectUri Gitlab callback URI,获取同上;注意:路径必须为/api/user/login_by_token

第二步:在根目录下执行如下命令下载插件

npm install https://github.com/landray/yapi-plugin-gitlab-oauth2.git 

第三步:重启服务器

参考资料:

1、GitLab as OAuth2 authentication service provider

Package Sidebar

Install

npm i yapi-plugin-gitlab-oauth2

Weekly Downloads

0

Version

1.0.0

License

none

Unpacked Size

4.19 kB

Total Files

6

Last publish

Collaborators

  • zhouzf