Skip to content

Commit 50d6a39

Browse files
vadmesteAnis Elleuchbexsoft
authored
idp: Use 900 seconds as minimum expiry without returning an error (#3022)
Do not bother the user with an error if the IDP expiry is less than 900 seconds, since the S3 spec sets a minimum of 900 seconds for STS expiration, use that minimum duration instead of returning an error Co-authored-by: Anis Elleuch <anis@min.io> Co-authored-by: Alex <33497058+bexsoft@users.noreply.github.com>
1 parent 467b6b9 commit 50d6a39

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/auth/idp/oauth2/provider.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,12 @@ func (client *Provider) VerifyIdentity(ctx context.Context, code, state, roleARN
341341
expiration = exp
342342
}
343343

344+
// Minimum duration in S3 spec is 15 minutes, do not bother returning
345+
// an error to the user and force the minimum duration instead
346+
if expiration < 900*time.Second {
347+
expiration = 900 * time.Second
348+
}
349+
344350
idToken := oauth2Token.Extra("id_token")
345351
if idToken == nil {
346352
return nil, errors.New("missing id_token")

0 commit comments

Comments
 (0)