Skip to content

Commit 19b4e47

Browse files
feat: Feat magic link (#279)
* licensemanager issuer * Refactor ParseApiToken to validate issuer. Updated the ParseApiToken method to include an expectedIssuer parameter and validate the token's issuer against it. Adjusted corresponding method calls to supply the correct issuer value for improved security and consistency. * removed expected issuer
1 parent 8c6fb75 commit 19b4e47

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

authenticator/middleware/sessionmanager.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ const (
4747
// ApiTokenClaimIssuer is the issuer who generated api-token for APIs
4848
ApiTokenClaimIssuer = "apiTokenIssuer"
4949

50+
LicenseManagerClaimIssuer = "licenseManagerIssuer"
51+
5052
// invalidLoginError, for security purposes, doesn't say whether the username or password was invalid. This does not mitigate the potential for timing attacks to determine which is which.
5153
invalidLoginError = "Invalid username or password"
5254
blankPasswordError = "Blank passwords are not allowed"
@@ -221,6 +223,8 @@ func (mgr *SessionManager) VerifyToken(tokenString string) (jwt.Claims, error) {
221223
return mgr.Parse(tokenString)
222224
case ApiTokenClaimIssuer:
223225
return mgr.ParseApiToken(tokenString)
226+
case LicenseManagerClaimIssuer:
227+
return mgr.ParseApiToken(tokenString)
224228
default:
225229
// IDP signed token
226230
prov, err := mgr.provider()

0 commit comments

Comments
 (0)