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
3badc383
Commit
3badc383
authored
5 years ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Modify the SSO URL to /login
parent
8d9e7f2b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
saml/saml.go
+8
-4
8 additions, 4 deletions
saml/saml.go
with
8 additions
and
4 deletions
saml/saml.go
+
8
−
4
View file @
3badc383
...
@@ -232,9 +232,9 @@ func NewSAMLIDP(config *Config) (http.Handler, error) {
...
@@ -232,9 +232,9 @@ func NewSAMLIDP(config *Config) (http.Handler, error) {
if
err
!=
nil
{
if
err
!=
nil
{
return
nil
,
err
return
nil
,
err
}
}
ssoURL
:=
baseURL
ssoURL
:=
*
baseURL
ssoURL
.
Path
+=
"/
sso
"
ssoURL
.
Path
+=
"/
login
"
metadataURL
:=
baseURL
metadataURL
:=
*
baseURL
metadataURL
.
Path
+=
"/metadata"
metadataURL
.
Path
+=
"/metadata"
svc
:=
fmt
.
Sprintf
(
"%s%s"
,
baseURL
.
Host
,
baseURL
.
Path
)
svc
:=
fmt
.
Sprintf
(
"%s%s"
,
baseURL
.
Host
,
baseURL
.
Path
)
if
!
strings
.
HasSuffix
(
svc
,
"/"
)
{
if
!
strings
.
HasSuffix
(
svc
,
"/"
)
{
...
@@ -246,11 +246,15 @@ func NewSAMLIDP(config *Config) (http.Handler, error) {
...
@@ -246,11 +246,15 @@ func NewSAMLIDP(config *Config) (http.Handler, error) {
return
nil
,
err
return
nil
,
err
}
}
// Create the SAML IdentityProvider, but then we put another
// mux.Router in front in order to wrap just the ssoURL with
// our own SSO handler.
idp
:=
&
saml
.
IdentityProvider
{
idp
:=
&
saml
.
IdentityProvider
{
Key
:
cert
.
PrivateKey
,
Key
:
cert
.
PrivateKey
,
Certificate
:
cert
.
Leaf
,
Certificate
:
cert
.
Leaf
,
Logger
:
logger
.
DefaultLogger
,
Logger
:
logger
.
DefaultLogger
,
SSOURL
:
*
ssoURL
,
MetadataURL
:
metadataURL
,
SSOURL
:
ssoURL
,
ServiceProviderProvider
:
config
,
ServiceProviderProvider
:
config
,
SessionProvider
:
users
,
SessionProvider
:
users
,
}
}
...
...
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