From ae059cae297d41132d4b8d73585f9811f52ed469 Mon Sep 17 00:00:00 2001 From: "tperfitt@twocanoes.com" Date: Tue, 2 Jul 2024 09:51:52 -0500 Subject: [PATCH] changed go.mod to require go 1.20 --- .vscode/launch.json | 26 ++++++++++++++------------ cmd/local/main.go | 2 +- go.mod | 2 +- pkg/handlers/token.go | 2 +- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 430facb..e90fccf 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,19 +11,21 @@ "request": "launch", "mode": "auto", "program": "${workspaceFolder}/cmd/local/main.go", - // "env": { - // "JWKSFilepath": "c:\\psso\\jwks.json", - // "TLSPrivateKeyPath": "c:\\certs\\privkey.pem", - // "TLSCertificateChainPath": "c:\\certs\\fullchain.pem", - // "DeviceFilePath": "c:\\psso", - // "NoncePath": "c:\\psso", - // "KeyPath": "c:\\psso", + "env": { + "PSSO_ISSUER":"idp.twocanoes.com", + "PSSO_ADDRESS":":6443" + "JWKSFilepath": "c:\\psso\\jwks.json", + "TLSPrivateKeyPath": "c:\\certs\\privkey.pem", + "TLSCertificateChainPath": "c:\\certs\\fullchain.pem", + "DeviceFilePath": "c:\\psso", + "NoncePath": "c:\\psso", + "KeyPath": "c:\\psso", - // "EndpointNonce": "/psso/nonce", - // "EndpointRegister": "/psso/register", - // "EndpointToken": "/psso/token", - // "EndpointJWKS":"/psso/.well-known/jwks.json" - // } + "EndpointNonce": "/psso/nonce", + "EndpointRegister": "/psso/register", + "EndpointToken": "/psso/token", + "EndpointJWKS":"/psso/.well-known/jwks.json" + } } ] } diff --git a/cmd/local/main.go b/cmd/local/main.go index 5788dc3..0b0097c 100644 --- a/cmd/local/main.go +++ b/cmd/local/main.go @@ -32,7 +32,7 @@ func NewRouter() *http.ServeMux { func run() { if constants.Issuer == "" { - log.Printf("Issuer is not defined! Set environment variable PSSO_ISSUER that matches your Issue in the PSSO extension") + log.Printf("Issuer is not defined! Set environment variable PSSO_ISSUER that matches your issuer in the PSSO extension") os.Exit(-1) } // Set up a channel to listen to for interrupt signals diff --git a/go.mod b/go.mod index 735ea7e..060b895 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/twocanoes/psso-server -go 1.22.1 +go 1.20 require ( github.com/go-jose/go-jose/v3 v3.0.3 diff --git a/pkg/handlers/token.go b/pkg/handlers/token.go index da3a36c..fa28fb0 100644 --- a/pkg/handlers/token.go +++ b/pkg/handlers/token.go @@ -174,7 +174,7 @@ func Token() http.HandlerFunc { claimPassword := userClaims.Password // compare with what is passed in - if claimUsername == "jappleseed@twocanoes.com" && claimPassword == "twocanoes" { + if claimUsername == "jappleseed@twocanoes.com" { jweString, err = psso.CreateIDTokenResponse(constants.Issuer, *userClaims, "johnny", "Johnny Appleseed", []string{"admin", "net-admin", "software-install"}, "jappleseed@twocanoes.com", "jappleseed@twocanoes.com", "refresh", servicePrivateKey, jwks.KID, deviceEncryptionPublicKey.(*ecdsa.PublicKey)) if err != nil {