Fixed some minor issues

This commit is contained in:
David J. Allen 2024-04-30 16:03:23 -06:00
parent 7022801fe9
commit e929fac09e
No known key found for this signature in database
GPG key ID: 717C593FF60A2ACC
4 changed files with 15 additions and 10 deletions

View file

@ -49,8 +49,8 @@ func (s *Server) StartIdentityProvider() error {
// update endpoints that have values set
defaultEps := oidc.Endpoints{
Authorization: "http://" + s.Addr + "/oauth/authorize",
Token: "http://" + s.Addr + "/oauth/token",
Authorization: "http://" + s.Addr + "/oauth2/authorize",
Token: "http://" + s.Addr + "/oauth2/token",
JwksUri: "http://" + s.Addr + "/.well-known/jwks.json",
}
oidc.UpdateEndpoints(&s.Issuer.Endpoints, &defaultEps)
@ -266,9 +266,13 @@ func (s *Server) StartIdentityProvider() error {
return
}
// check that we're using the default registered client
if clientId != "ochami" {
fmt.Printf("invalid client\n")
// find a valid client
index := slices.IndexFunc(s.Issuer.Clients, func(c RegisteredClient) bool {
fmt.Printf("%s ? %s\n", c.Id, clientId)
return c.Id == clientId
})
if index < 0 {
fmt.Printf("no valid client found")
return
}