@@ -10,6 +10,7 @@ import (
1010 "io"
1111 "math/big"
1212 "net/http"
13+ "os"
1314 "strings"
1415 "testing"
1516 "time"
@@ -66,6 +67,14 @@ func TestExternalOIDCWithKeycloak(t *testing.T) {
6667
6768 checkFeatureGatesOrSkip (t , testCtx , testClient .configClient , features .FeatureGateExternalOIDC , features .FeatureGateExternalOIDCWithAdditionalClaimMappings )
6869
70+ if idpURL := os .Getenv ("EXTERNAL_OIDC_URL" ); len (idpURL ) > 0 {
71+ transport , err := rest .TransportFor (testClient .kubeConfig )
72+ require .NoError (t , err )
73+ kcClient := test .KeycloakClientFor (t , transport , idpURL , "master" )
74+ testClient .testOIDCAuthentication (t , testCtx , kcClient , "email" , "oidc-test:" , true )
75+ return
76+ }
77+
6978 // post-test cluster cleanup
7079 var cleanups []func ()
7180 defer test .IDPCleanupWrapper (func () {
@@ -102,6 +111,12 @@ func TestExternalOIDCWithKeycloak(t *testing.T) {
102111 caBundleName := idpName + "-ca"
103112 idpURL := kcClient .IssuerURL ()
104113
114+ if len (os .Getenv ("OPENSHIFT_ONLY_IDP" )) > 0 {
115+ t .Logf ("issuer URL: %s" , idpURL )
116+ t .Logf ("idp CA: %s" , caBundleName )
117+ return
118+ }
119+
105120 // run tests
106121
107122 testSpec := authSpecForOIDCProvider (idpName , idpURL , caBundleName , oidcGroupsClaim , oidcClientId )
0 commit comments