Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
go-sso
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
6
Issues
6
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
id
go-sso
Commits
1724c178
Commit
1724c178
authored
Nov 16, 2018
by
ale
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add documentation for keystore_enable_groups
parent
7fec26e6
Pipeline
#1574
failed with stages
in 1 minute and 20 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
3 deletions
+8
-3
README.md
README.md
+2
-0
server/http_test.go
server/http_test.go
+3
-2
server/login.go
server/login.go
+3
-1
No files found.
README.md
View file @
1724c178
...
...
@@ -61,6 +61,8 @@ attributes:
*
`cert`
: path to the client certificate
*
`key`
: path to the private key
*
`ca`
: path to the CA used to validate the server
*
`keystore_enable_groups`
: (a list) if set, the keystore will only be
enabled for users that are members of these groups
*
`u2f_app_id`
: set the U2F AppID - if unset, it will be autodetected
based on the domain name in the request
*
`url_path_prefix`
: URL path prefix of the SSO server application
...
...
server/http_test.go
View file @
1724c178
...
...
@@ -24,11 +24,12 @@ type fakeAuthClient struct{}
func
(
c
*
fakeAuthClient
)
Authenticate
(
_
context
.
Context
,
req
*
auth
.
Request
)
(
*
auth
.
Response
,
error
)
{
p
:=
string
(
req
.
Password
)
info
:=
&
auth
.
UserInfo
{
Shard
:
"shard1"
}
switch
{
case
req
.
Username
==
"testuser"
&&
p
==
"password"
:
return
&
auth
.
Response
{
Status
:
auth
.
StatusOK
},
nil
return
&
auth
.
Response
{
Status
:
auth
.
StatusOK
,
UserInfo
:
info
},
nil
case
req
.
Username
==
"test2fa"
&&
p
==
"password"
&&
req
.
OTP
==
"123456"
:
return
&
auth
.
Response
{
Status
:
auth
.
StatusOK
},
nil
return
&
auth
.
Response
{
Status
:
auth
.
StatusOK
,
UserInfo
:
info
},
nil
case
req
.
Username
==
"test2fa"
&&
p
==
"password"
:
return
&
auth
.
Response
{
Status
:
auth
.
StatusInsufficientCredentials
,
...
...
server/login.go
View file @
1724c178
...
...
@@ -135,7 +135,9 @@ func (l *loginHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
switch
newState
{
case
loginStateSuccess
:
// Successful login. Delete the login session.
// Successful login. Delete the login session and invoke
// the login callback, before redirecting to the
// original URL.
httpSession
.
Options
.
MaxAge
=
-
1
if
err
:=
httpSession
.
Save
(
req
,
w
);
err
!=
nil
{
log
.
Printf
(
"login error saving session: %v"
,
err
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment