Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
Change name of token-cookie set by SAML library
Browse files Browse the repository at this point in the history
  • Loading branch information
mrajashree authored and Craig Jellick committed Jul 14, 2018
1 parent 510fbcb commit 3a4bc9b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 8 additions & 0 deletions providers/shibboleth/shibboleth_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,14 @@ func (sp *SPClient) initializeSPClient(configToSet *model.ShibbolethConfig) erro
log.Errorf("Error initializing SAML SP instance from the config %v, error %v", configToSet, err)
}

cookieStore := samlsp.ClientCookies{
ServiceProvider: &samlspInstance.ServiceProvider,
Name: "samlToken",
Domain: actURL.Host,
}
samlspInstance.ClientState = &cookieStore
samlspInstance.ClientToken = &cookieStore

if idpURL != "" {
tr := &http.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
Expand Down
4 changes: 2 additions & 2 deletions service/route_handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ func Reload(w http.ResponseWriter, r *http.Request) {
func HandleSamlPost(w http.ResponseWriter, r *http.Request) {
//get all X-Saml- headers and pass it to the provider
log.Debugf("HandleSamlPost: request url is %v", r.URL.String())
cookie, _ := r.Cookie("token")
log.Infof("token cookie: %v", cookie)
cookie, _ := r.Cookie("samlToken")
log.Infof("token cookie: %#v", cookie)

samlData := make(map[string][]string)

Expand Down
2 changes: 1 addition & 1 deletion trash.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ github.com/rancher/go-rancher cc9af4572762fc6ae01f5f9bebbc359506c2f6dd
github.com/tomnomnom/linkheader 0.1.0-5-g236df73
golang.org/x/sys a646d33
github.com/urfave/cli v1.18.0
github.com/crewjam/saml c1c892357b136a16a617ef802d7b6da7d3b414dc https://github.com/mrajashree/saml
github.com/crewjam/saml ce1532152fdecd37a8b9a059dc0129730174200d https://github.com/rancher/saml
github.com/crewjam/errset f78d65de925cf59a953184a376cbfe07cfe65e3d
gopkg.in/ldap.v2 v2.5.0
gopkg.in/asn1-ber.v1 v1.1
Expand Down

0 comments on commit 3a4bc9b

Please sign in to comment.