diff --git a/internal/controller/oidcapp_controller.go b/internal/controller/oidcapp_controller.go index 600031c..ce4df04 100644 --- a/internal/controller/oidcapp_controller.go +++ b/internal/controller/oidcapp_controller.go @@ -144,10 +144,11 @@ func (wr *wrappedOIDCAppReconciler) Reconcile(ctx context.Context, ztdClient *cl return fmt.Errorf("Error listing OIDCApps: %v", err) } + fmt.Println(appList.Applications) + if len(appList.Applications) > 0 { - fmt.Println(appList.Applications) appid = &appList.Applications[0].ApplicationId - clientid = &appList.Applications[0].GetApiConfiguration().ClientId + clientid = &appList.Applications[0].GetOidcConfiguration().ClientId } if appid == nil { @@ -191,7 +192,7 @@ func (wr *wrappedOIDCAppReconciler) Reconcile(ctx context.Context, ztdClient *cl Namespace: wr.OIDCApp.Namespace, } - secretData := map[string][]byte{"clientSecret": []byte(resp.GetApiConfiguration().ClientSecret), "appId": []byte(resp.ApplicationId), "clientId": []byte(resp.GetApiConfiguration().ClientId)} + secretData := map[string][]byte{"clientSecret": []byte(resp.GetApiConfiguration().ClientSecret), "appId": []byte(resp.ApplicationId), "clientId": []byte(resp.GetOidcConfiguration().ClientId)} secret, err := wr.Builder.BuildSecret(builder.SecretOpts{Immutable: false, Key: key, Data: secretData}, wr.OIDCApp) if err != nil { return fmt.Errorf("error building Secret: %v", err) @@ -200,7 +201,7 @@ func (wr *wrappedOIDCAppReconciler) Reconcile(ctx context.Context, ztdClient *cl return fmt.Errorf("error creating Client-secret Secret: %v", err) } appid = &resp.ApplicationId - clientid = &resp.GetApiConfiguration().ClientId + clientid = &resp.GetOidcConfiguration().ClientId } else { _, err := ztdClient.ApplicationServiceV2().UpdateApplication(ctx, &application.UpdateApplicationRequest{