Skip to content

Commit 9c0bd07

Browse files
committed
Respect SP choice for NameID, and create test users separately
1 parent 8711f75 commit 9c0bd07

File tree

2 files changed

+2
-32
lines changed

2 files changed

+2
-32
lines changed

example/idp/go.mod

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,14 @@ go 1.23
44

55
toolchain go1.24.2
66

7-
require (
8-
github.com/crewjam/saml v0.5.1
9-
golang.org/x/crypto v0.33.0
10-
)
7+
require github.com/crewjam/saml v0.5.1
118

129
require (
1310
github.com/beevik/etree v1.5.0 // indirect
1411
github.com/jonboulle/clockwork v0.2.2 // indirect
1512
github.com/mattermost/xml-roundtrip-validator v0.1.0 // indirect
1613
github.com/russellhaering/goxmldsig v1.4.0 // indirect
14+
golang.org/x/crypto v0.33.0 // indirect
1715
)
1816

1917
// Replace the remote saml module with your local version

example/idp/idp.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import (
88
"net/http"
99
"net/url"
1010

11-
"golang.org/x/crypto/bcrypt"
12-
1311
"github.com/crewjam/saml/logger"
1412
"github.com/crewjam/saml/samlidp"
1513
)
@@ -47,31 +45,5 @@ func main() {
4745
logr.Fatalf("%s", err)
4846
}
4947

50-
hashedPassword, _ := bcrypt.GenerateFromPassword([]byte("hunter2"), bcrypt.DefaultCost)
51-
err = idpServer.Store.Put("/users/alice", samlidp.User{Name: "alice",
52-
HashedPassword: hashedPassword,
53-
Groups: []string{"Administrators", "Users"},
54-
Email: "alice@example.com",
55-
CommonName: "Alice Smith",
56-
Surname: "Smith",
57-
GivenName: "Alice",
58-
})
59-
if err != nil {
60-
logr.Fatalf("%s", err)
61-
}
62-
63-
err = idpServer.Store.Put("/users/bob", samlidp.User{
64-
Name: "bob",
65-
HashedPassword: hashedPassword,
66-
Groups: []string{"Users"},
67-
Email: "bob@example.com",
68-
CommonName: "Bob Smith",
69-
Surname: "Smith",
70-
GivenName: "Bob",
71-
})
72-
if err != nil {
73-
logr.Fatalf("%s", err)
74-
}
75-
7648
http.ListenAndServe(":8080", idpServer)
7749
}

0 commit comments

Comments
 (0)