From 84f966b516fd150820f6744d25443d2bda3b36b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Leonard?= Date: Thu, 29 Oct 2020 18:02:50 +0100 Subject: [PATCH] #199 fix oauth2 --- admin/configuration.md | 56 ++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 21 deletions(-) diff --git a/admin/configuration.md b/admin/configuration.md index b5a0ef2..2e36466 100644 --- a/admin/configuration.md +++ b/admin/configuration.md @@ -283,28 +283,42 @@ Authenticate the user using an external OAuth2 authenticator server. The configu ##### Example - auth { +``` +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"] - } - - [..] - - } + provider = [local, oauth2] + + [..] + + sso { + autocreate: false + autoupdate: false + mapper: "simple" + attributes { + login: "login" + name: "name" + roles: "role" + } + defaultRoles: ["read", "analyze"] + defaultOrganization: "demo" + } + oauth2 { + name: oauth2 + clientId: "ed630d47c1863cf8fd02" + clientSecret: "31b14bff999b676844728e0b4405c95ff1923de3" + redirectUri: "http://localhost:9112/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"] + } + + [..] +} +``` #### 3.2.1. Roles mappings