keycloak: SSL Mode not working?

Before reporting an issue

Area

operator

Describe the bug

When setting the realms SSLMode to “External Requests”, according to the documentation I should be able to use openid connect from within the local cluster network 10.x.x.x. However I get the following error message:

oidc: issuer did not match the issuer returned by provider, expected "http://keycloak-service:8080/realms/myrealm" got "https://keycloak-service:8080/realms/myrealm"

Version

quay.io/keycloak/keycloak:20.0.2

Expected behavior

I can use openid connect

Actual behavior

I get the following error:

oidc: issuer did not match the issuer returned by provider, expected "http://keycloak-service:8080/realms/myrealm" got "https://keycloak-service:8080/realms/myrealm"

How to Reproduce?

Keycloak deployment (using operator):

apiVersion: k8s.keycloak.org/v2alpha1
kind: Keycloak
metadata:
  name: keycloak
spec:
  instances: 2
  db:
    vendor: postgres
    host: pg-auth-rw
    database: keycloak
    usernameSecret:
      name: pg-auth-superuser
      key: username
    passwordSecret:
      name: pg-auth-superuser
      key: password
  http:
    httpEnabled: true
  hostname:
    strict: false
  ingress:
    enabled: false
  unsupported:
    podTemplate:
      metadata:
        annotations:
          linkerd.io/inject: enabled
        labels:
          my-label: "keycloak"

Go application:

package main

import (
	"context"
	"github.com/coreos/go-oidc"
)


func main() {
	var err error

	ctx := context.Background()

	issuerURL := "http://keycloak-service:8080/realms/myrealm"

	provider, err = oidc.NewProvider(ctx, issuerURL)

	if err != nil {
		log.Fatalf("Failed to get provider: %v", err)
	}
}

Anything else?

https://github.com/coreos/go-oidc/issues/386

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 26 (15 by maintainers)

Most upvoted comments

But I’m not sure if the additional options field is working.

Seems not for some reason…

@vmuzikar If we could re-use the validation from Picocli, that would be great.

For instance, convert any env var prefixed with KC_ to its corresponding CLI format and then run validations. The main issue I see is the impact on re-aug and startup times. Mainly the latter.

I’m also not sure how to deal with the output from Picocli to better show messages when using env vars.

Perhaps we should favor usability here, even if it increases a bit more time.