From 10e1777d9ee944589057099958e78d3f25a8201c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leonard?= Date: Thu, 29 Oct 2020 17:58:05 +0100 Subject: [PATCH] #199 fix oauth2 --- admin/configuration.md | 70 +++++++++++++----------------------------- 1 file changed, 22 insertions(+), 48 deletions(-) diff --git a/admin/configuration.md b/admin/configuration.md index 7de115f..b5a0ef2 100644 --- a/admin/configuration.md +++ b/admin/configuration.md @@ -244,39 +244,6 @@ session { } ``` -#### OAUTH2 Example - -``` - oauth2 { - name: oauth2 - clientId: "client-id" - clientSecret: "client-secret" - redirectUri: "http://localhost:9000/api/ssoLogin" - responseType: code - grantType: "authorization_code" - authorizationUrl: "https://github.com/login/oauth/authorize" - authorizationHeader: "token" - tokenUrl: "https://github.com/login/oauth/access_token" - userUrl: "https://api.github.com/user" - scope: ["user"] - } - -sso { - autocreate: false - autoupdate: false - mapper: "simple" - attributes { - login: "login" - name: "name" - roles: "role" - } - defaultRoles: ["read", "write"] - defaultOrganization: "demo" - } - - -``` - ### 3.1. LDAP/AD @@ -314,22 +281,29 @@ Authenticate the user using an external OAuth2 authenticator server. The configu - userUrl (string) the url to get user information in OAuth2 server. - scope (list of string) list of scope. +##### Example - -Example: - - oauth2 { - name: oauth2 - clientId: "client-id" - clientSecret: "client-secret" - redirectUri: "http://localhost:9000/api/ssoLogin" - responseType: code - grantType: "authorization_code" - authorizationUrl: "https://github.com/login/oauth/authorize" - authorizationHeader: "token" - tokenUrl: "https://github.com/login/oauth/access_token" - userUrl: "https://api.github.com/user" - scope: ["user"] + auth { + + provider = [local, oauth2] + [..] + + oauth2 { + name: oauth2 + clientId: "client-id" + clientSecret: "client-secret" + redirectUri: "http://localhost:9000/api/ssoLogin" + responseType: code + grantType: "authorization_code" + authorizationUrl: "https://github.com/login/oauth/authorize" + authorizationHeader: "token" + tokenUrl: "https://github.com/login/oauth/access_token" + userUrl: "https://api.github.com/user" + scope: ["user"] + } + + [..] + }