forked from TrueCloudLab/certificates
Use GetTokenID.
This commit is contained in:
parent
2c68915b70
commit
27c98806c0
1 changed files with 1 additions and 8 deletions
|
@ -64,14 +64,7 @@ func (a *Authority) authorizeToken(ott string) (provisioner.Interface, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store the token to protect against reuse.
|
// Store the token to protect against reuse.
|
||||||
var reuseKey string
|
if reuseKey, err := p.GetTokenID(ott); err == nil {
|
||||||
switch p.GetType() {
|
|
||||||
case provisioner.TypeJWK:
|
|
||||||
reuseKey = claims.ID
|
|
||||||
case provisioner.TypeOIDC:
|
|
||||||
reuseKey = claims.Nonce
|
|
||||||
}
|
|
||||||
if reuseKey != "" {
|
|
||||||
if _, ok := a.ottMap.LoadOrStore(reuseKey, &idUsed{
|
if _, ok := a.ottMap.LoadOrStore(reuseKey, &idUsed{
|
||||||
UsedAt: time.Now().Unix(),
|
UsedAt: time.Now().Unix(),
|
||||||
Subject: claims.Subject,
|
Subject: claims.Subject,
|
||||||
|
|
Loading…
Add table
Reference in a new issue