Add https scheme for initial zitadel client
[ZITADOPER-1]
This commit is contained in:
@@ -426,7 +426,11 @@ func (r *ZitadelClusterReconciler) reconcileDefaultInstance(ctx context.Context,
|
||||
}
|
||||
|
||||
func GetIssuer(zitadel *zitadelv1alpha1.ZitadelCluster) string {
|
||||
return fmt.Sprintf("http://%s:%d", zitadel.Spec.Host, zitadel.Spec.ExternalPort)
|
||||
scheme := "http"
|
||||
if zitadel.Spec.ExternalSecure {
|
||||
scheme = "https"
|
||||
}
|
||||
return fmt.Sprintf("%s://%s:%d", scheme, zitadel.Spec.Host, zitadel.Spec.ExternalPort)
|
||||
}
|
||||
|
||||
func GetAPI(zitadel *zitadelv1alpha1.ZitadelCluster) string {
|
||||
|
||||
@@ -36,7 +36,7 @@ func NewClient(ctx context.Context, zitadelCluster *zitadelv1alpha1.ZitadelClust
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
api, err := management.NewClient(GetIssuer(zitadelCluster), fmt.Sprintf("%s", GetAPI(zitadelCluster)), []string{oidc.ScopeOpenID, zitadel.ScopeZitadelAPI()}, zitadel.WithInsecure(), zitadel.WithJWTProfileTokenSource(Discover([]byte(machineKeyData), GetAPIUrl(zitadelCluster), GetAuthority(zitadelCluster), GetAPI(zitadelCluster))),
|
||||
api, err := management.NewClient(GetIssuer(zitadelCluster), GetAPI(zitadelCluster)), []string{oidc.ScopeOpenID, zitadel.ScopeZitadelAPI()}, zitadel.WithInsecure(), zitadel.WithJWTProfileTokenSource(Discover([]byte(machineKeyData), GetAPIUrl(zitadelCluster), GetAuthority(zitadelCluster), GetAPI(zitadelCluster))),
|
||||
zitadel.WithDialOptions(grpc.WithAuthority(GetAuthority(zitadelCluster))),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user