fix: improve oidc issuer / endpoints (#3753)

* fix: improve oidc issuer / endpoints

* docs: update endpoints
This commit is contained in:
Livio Spring
2022-06-07 10:04:51 +02:00
committed by GitHub
parent 3a1569bd94
commit 5e4b38d69b
6 changed files with 32 additions and 20 deletions

View File

@@ -15,7 +15,7 @@ func (s *Server) Healthz(context.Context, *mgmt_pb.HealthzRequest) (*mgmt_pb.Hea
}
func (s *Server) GetOIDCInformation(ctx context.Context, _ *mgmt_pb.GetOIDCInformationRequest) (*mgmt_pb.GetOIDCInformationResponse, error) {
issuer := http.BuildOrigin(authz.GetInstance(ctx).RequestedDomain(), s.externalSecure) + s.issuerPath
issuer := http.BuildOrigin(authz.GetInstance(ctx).RequestedHost(), s.externalSecure)
return &mgmt_pb.GetOIDCInformationResponse{
Issuer: issuer,
DiscoveryEndpoint: issuer + oidc.DiscoveryEndpoint,

View File

@@ -31,7 +31,6 @@ type Server struct {
passwordHashAlg crypto.HashAlgorithm
userCodeAlg crypto.EncryptionAlgorithm
externalSecure bool
issuerPath string
auditLogRetention time.Duration
}
@@ -41,7 +40,6 @@ func CreateServer(
sd systemdefaults.SystemDefaults,
userCodeAlg crypto.EncryptionAlgorithm,
externalSecure bool,
issuerPath string,
auditLogRetention time.Duration,
) *Server {
return &Server{
@@ -52,7 +50,6 @@ func CreateServer(
passwordHashAlg: crypto.NewBCrypt(sd.SecretGenerators.PasswordSaltCost),
userCodeAlg: userCodeAlg,
externalSecure: externalSecure,
issuerPath: issuerPath,
auditLogRetention: auditLogRetention,
}
}

View File

@@ -26,10 +26,6 @@ import (
"github.com/zitadel/zitadel/internal/telemetry/metrics"
)
const (
HandlerPrefix = "/oauth/v2"
)
type Config struct {
CodeMethodS256 bool
AuthMethodPost bool
@@ -89,7 +85,7 @@ func NewProvider(ctx context.Context, config Config, defaultLogoutRedirectURI st
}
provider, err := op.NewDynamicOpenIDProvider(
ctx,
HandlerPrefix,
"",
opConfig,
storage,
options...,