fix: Add support for DurationSeconds in LDAP STS API (#12778)

This commit is contained in:
Aditya Manthramurthy
2021-07-22 12:13:21 -07:00
committed by GitHub
parent 17a37241f0
commit a3079a7de2
3 changed files with 70 additions and 6 deletions

View File

@@ -541,7 +541,12 @@ func (sts *stsAPIHandlers) AssumeRoleWithLDAPIdentity(w http.ResponseWriter, r *
return
}
expiryDur := globalLDAPConfig.GetExpiryDuration()
expiryDur, err := globalLDAPConfig.GetExpiryDuration(r.Form.Get(stsDurationSeconds))
if err != nil {
writeSTSErrorResponse(ctx, w, true, ErrSTSInvalidParameterValue, err)
return
}
m := map[string]interface{}{
expClaim: UTCNow().Add(expiryDur).Unix(),
ldapUser: ldapUserDN,