Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
go-sso
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
id
go-sso
Commits
1724c178
Commit
1724c178
authored
6 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Add documentation for keystore_enable_groups
parent
7fec26e6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+2
-0
2 additions, 0 deletions
README.md
server/http_test.go
+3
-2
3 additions, 2 deletions
server/http_test.go
server/login.go
+3
-1
3 additions, 1 deletion
server/login.go
with
8 additions
and
3 deletions
README.md
+
2
−
0
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
...
...
This diff is collapsed.
Click to expand it.
server/http_test.go
+
3
−
2
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
,
...
...
This diff is collapsed.
Click to expand it.
server/login.go
+
3
−
1
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
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment