force https for auth proxy and dex server
@@ -394,14 +394,6 @@ func (r *SingleSignOnConfigReconcilerTask) ReconcileDexComponent() error {
func (r *SingleSignOnConfigReconcilerTask) ReconcileDexRoute() error {
timeout := 5
- var scheme string
-
- if r.ssoConfig.Spec.UseHttp {
- scheme = "http"
- } else {
- scheme = "https"
- }
-
dexRoute := corev1alpha1.HttpRoute{
ObjectMeta: metaV1.ObjectMeta{
Name: KALM_DEX_NAME,
@@ -423,7 +415,8 @@ func (r *SingleSignOnConfigReconcilerTask) ReconcileDexRoute() error {
"TRACE",
},
Paths: []string{"/dex"},
- Schemes: []string{scheme},
+ Schemes: []string{"http", "https"},
+ HttpRedirectToHttps: !r.ssoConfig.Spec.UseHttp,
Destinations: []corev1alpha1.HttpRouteDestination{
{
Host: fmt.Sprintf("%s.%s.svc.cluster.local:%d", KALM_DEX_NAME, KALM_DEX_NAMESPACE, 5556),
@@ -601,14 +594,6 @@ func (r *SingleSignOnConfigReconcilerTask) ReconcileInternalAuthProxyComponent()
func (r *SingleSignOnConfigReconcilerTask) ReconcileInternalAuthProxyRoute() error {
timeout := 5
- var scheme string
-
- if r.ssoConfig.Spec.UseHttp {
- scheme = "http"
- } else {
- scheme = "https"
- }
-
authProxyRoute := corev1alpha1.HttpRoute{
ObjectMeta: metaV1.ObjectMeta{
Name: KALM_AUTH_PROXY_NAME,
@@ -622,7 +607,8 @@ func (r *SingleSignOnConfigReconcilerTask) ReconcileInternalAuthProxyRoute() err
"GET",
},
Paths: []string{"/oidc/login", "/oidc/callback"},
- Schemes: []string{scheme},
+ Schemes: []string{"http", "https"},
+ HttpRedirectToHttps: !r.ssoConfig.Spec.UseHttp,
Destinations: []corev1alpha1.HttpRouteDestination{
{
Host: fmt.Sprintf("%s.%s.svc.cluster.local", KALM_AUTH_PROXY_NAME, KALM_DEX_NAMESPACE),
