From 3e66c7b14bf6cfd54531a00187ebb27db5065d04 Mon Sep 17 00:00:00 2001 From: guy-har Date: Tue, 9 Apr 2024 17:20:15 +0300 Subject: [PATCH] Use username as subject (#7637) --- pkg/api/controller.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/api/controller.go b/pkg/api/controller.go index 8c9125c284a..b66312d780a 100644 --- a/pkg/api/controller.go +++ b/pkg/api/controller.go @@ -566,7 +566,7 @@ func (c *Controller) StsLogin(w http.ResponseWriter, r *http.Request, body apige return } // validate a user exists with the external user id - _, err = c.Auth.GetUserByExternalID(ctx, externalUserID) + user, err := c.Auth.GetUserByExternalID(ctx, externalUserID) if c.handleAPIError(ctx, w, r, err) { return } @@ -576,7 +576,7 @@ func (c *Controller) StsLogin(w http.ResponseWriter, r *http.Request, body apige } now := time.Now() expiresAt := now.Add(time.Duration(expiresInSec) * time.Second) - token, err := GenerateJWTLogin(c.Auth.SecretStore().SharedSecret(), externalUserID, now, expiresAt) + token, err := GenerateJWTLogin(c.Auth.SecretStore().SharedSecret(), user.Username, now, expiresAt) if c.handleAPIError(ctx, w, r, err) { return }