Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 4 of 4 for ExtractClaims (0.09 sec)

  1. internal/auth/credentials.go

    	m["accessKey"] = accessKey
    	jwt := jwtgo.NewWithClaims(jwtgo.SigningMethodHS512, jwtgo.MapClaims(m))
    	return jwt.SignedString([]byte(tokenSecret))
    }
    
    // ExtractClaims extracts JWT claims from a security token using a secret key
    func ExtractClaims(token, secretKey string) (*jwt.MapClaims, error) {
    	if token == "" || secretKey == "" {
    		return nil, errors.New("invalid argument")
    	}
    
    	claims := jwt.NewMapClaims()
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue May 28 17:14:16 UTC 2024
    - 12K bytes
    - Viewed (0)
  2. cmd/auth-handler.go

    	// on the client side and is treated like an opaque value.
    	claims, err := auth.ExtractClaims(token, secret)
    	if err != nil {
    		if subtle.ConstantTimeCompare([]byte(secret), []byte(globalActiveCred.SecretKey)) == 1 {
    			return nil, errAuthentication
    		}
    		claims, err = auth.ExtractClaims(token, globalActiveCred.SecretKey)
    		if err != nil {
    			return nil, errAuthentication
    		}
    	}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Sep 17 16:45:46 UTC 2024
    - 26.1K bytes
    - Viewed (0)
  3. cmd/iam.go

    				jwtClaims, err = auth.ExtractClaims(cred.SessionToken, cred.SecretKey)
    				if err != nil {
    					jwtClaims, err = auth.ExtractClaims(cred.SessionToken, globalActiveCred.SecretKey)
    				}
    			} else {
    				var secretKey string
    				secretKey, err = getTokenSigningKey()
    				if err != nil {
    					continue
    				}
    				jwtClaims, err = auth.ExtractClaims(cred.SessionToken, secretKey)
    			}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Oct 29 16:01:48 UTC 2024
    - 74.6K bytes
    - Viewed (0)
  4. cmd/site-replication.go

    			}
    		}
    	}
    	secretKey, err := getTokenSigningKey()
    	if err != nil {
    		return errSRInvalidRequest(err)
    	}
    
    	// Verify the session token of the stsCred
    	claims, err := auth.ExtractClaims(stsCred.SessionToken, secretKey)
    	if err != nil {
    		return fmt.Errorf("STS credential could not be verified: %w", err)
    	}
    
    	mapClaims := claims.Map()
    	expiry, err := auth.ExpToInt64(mapClaims["exp"])
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Thu Aug 15 12:04:40 UTC 2024
    - 185.1K bytes
    - Viewed (0)
Back to top