Skip to content

Commit

Permalink
Use username as subject (#7637)
Browse files Browse the repository at this point in the history
  • Loading branch information
guy-har committed Apr 9, 2024
1 parent b9a81bc commit 3e66c7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/api/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
}
Expand Down

0 comments on commit 3e66c7b

Please sign in to comment.