From 27c98806c034ff253985309693b4d5f7ac0cc6d8 Mon Sep 17 00:00:00 2001 From: Mariano Cano Date: Wed, 24 Apr 2019 11:29:57 -0700 Subject: [PATCH] Use GetTokenID. --- authority/authorize.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/authority/authorize.go b/authority/authorize.go index 62152d09..a53c2d8d 100644 --- a/authority/authorize.go +++ b/authority/authorize.go @@ -64,14 +64,7 @@ func (a *Authority) authorizeToken(ott string) (provisioner.Interface, error) { } // Store the token to protect against reuse. - var reuseKey string - switch p.GetType() { - case provisioner.TypeJWK: - reuseKey = claims.ID - case provisioner.TypeOIDC: - reuseKey = claims.Nonce - } - if reuseKey != "" { + if reuseKey, err := p.GetTokenID(ott); err == nil { if _, ok := a.ottMap.LoadOrStore(reuseKey, &idUsed{ UsedAt: time.Now().Unix(), Subject: claims.Subject,