Commit graph

37 commits

Author SHA1 Message Date
Peter Kieltyka
ecb7305746 add JWTAuth#ValidateOptions method 2023-12-05 13:31:10 -05:00
Peter Kieltyka
fc3832839d jwtauth.New to accept jwt.ValidateOptions 2023-11-21 15:57:10 -05:00
Peter Kieltyka
36417065f8 update docs 2023-01-03 12:16:33 -05:00
Nicola Murino
84b5aa8ecb
use jwx v2 (#73) 2022-11-13 11:18:43 -05:00
kvii
137d669fb7
remove unnecessary code. (#69) 2022-02-09 06:21:49 -05:00
Nicola Murino
52c0aa2d7c
fix compatibility with jwx 1.1.0 (#55) 2021-01-31 16:35:32 -05:00
Peter Kieltyka
38df5c8c2e Update Verifier for locating jwt token; removing TokenFromQuery from defaults 2020-12-12 14:55:17 -05:00
Peter Kieltyka
b8af768272
Switch to github.com/lestrrat-go/jwx underlying jwt library (#52) 2020-12-12 09:40:27 -05:00
hmkwizu
b14bfcd999
fix incorrect error checking for NBF (#47) 2020-02-03 17:30:09 -05:00
Peter Kieltyka
aa727a6feb goimports 2019-01-09 10:43:31 -05:00
Peter Kieltyka
fcf2c975be add MapClaims helper methods 2018-09-26 13:55:45 -04:00
Jonathan ES Lin
ea7d7e213f Remove unnecessary code and clean up errors (#30)
* Initial refactor

* Fix some of the tests

* Handle more specific errors from jwt library

* Fix comments

* Rename package

* Verify signing algo after nil check
2018-09-26 10:43:54 -07:00
Tomaz Lovrec
508040879e Truly support jwtauth.Claims when parsing from context
Previous change "fixed" the panic, but would silently remove all Claims,
because the tokenClaims are not copied over to the claims variable.
2018-02-28 17:17:42 +01:00
Vojtech Vitek
fdeab96f74 Support jwtauth.Claims in FromContext(), fixes panic (#25) 2018-01-17 22:14:14 -05:00
Vojtech Vitek
ca8a698a9c Add ErrNoTokenFound verify error 2018-01-17 19:24:00 -05:00
Peter Kieltyka
47cdb657f2 Verifier functions should not be vars 2017-11-26 12:32:19 -05:00
Peter Kieltyka
ace6ea2799 Lint fix, rename JwtAuth to JWTAuth 2017-11-26 10:34:54 -05:00
Lukas Malkmus
e6503c425b Implement custom search functions (#20)
* Implement custom search functions

* Improve function and parameter names

* Preserve original search order
2017-10-10 06:29:25 -04:00
Emil Nikolov
050a030f1c Changed the expected key type from []byte to interface{} to match the method signatures of jwt-go and added a test (#22) 2017-10-10 06:26:11 -04:00
Peter Kieltyka
89031fb71d Remove old comments 2017-08-08 12:49:28 -04:00
Peter Kieltyka
1281aa5c53 Add VerifyRequest func to verify requests directly 2017-07-12 21:25:34 -04:00
Peter Kieltyka
287076f82d Keep jwt.Token.Claims as a jwt.MapClaims type 2017-07-10 21:30:13 -04:00
Peter Kieltyka
6444fb9aef Move Verifier method to pkg-level func to accept *jwtauth.JwtAuth 2017-07-06 18:09:09 -04:00
Peter Kieltyka
92a7a642f5 Make IsExpired a func instead of method, and rename SetContext method to NewContext func 2017-07-06 16:49:11 -04:00
Peter Kieltyka
1e267ab0c7 Rename TokenContext method to FromContext 2017-07-06 15:23:11 -04:00
Peter Kieltyka
4c654d77d5 Refactor jwtauth pkg, move to go-chi org, and support dgrijalva/jwt-go v3 2017-07-05 17:05:27 -04:00
Vojtech Vitek (V-Teq)
c97496f7ab JWT Auth for go1.7 2016-07-11 17:51:29 -04:00
Hafiz Ismail
fde476f0a7 Added stricter check for edge-case when token is nil 2016-02-03 19:59:37 +08:00
Hafiz Ismail
293f48cc84 Fixed an issue with panic error when token supplied was signed with a different
`alg` method than expected

```
	...
	token, err := ja.Decode(tokenStr)
	if err != nil || !token.Valid || token.Method != ja.signer {
		switch err.Error() { ... } // panic when `err == nil` but `token.Method != ja.signer`
		...
	}

```

Added test to cover this case.
2016-02-03 19:53:31 +08:00
Peter Kieltyka
08ef428913 Add SetExpiry method to Claims type to set a specific expiry time 2016-01-21 15:49:07 -05:00
Peter Kieltyka
4179debd0a Case for when exp value is json.Number with custom parser 2016-01-21 14:45:08 -05:00
Peter Kieltyka
4db4f7e78f Typo 2016-01-21 14:08:11 -05:00
Peter Kieltyka
079feacddb Minor 2016-01-21 14:07:01 -05:00
Peter Kieltyka
a872c75843 Handler improvements, Claims type, expiry and tests 2016-01-21 14:00:36 -05:00
Peter Kieltyka
6635f4beea Check exp claim if its provided 2016-01-19 17:43:58 -05:00
Maciej Lisiewski
2126d26c06 Adds support for custom parser settings added to jwt-go 2.4.0
Biggest benefit: you can have json.Numeric claims instead of all
numbers defaulting to float64

This change is 100% backwards compatible
2016-01-19 12:05:48 -05:00
Peter Kieltyka
2df91be798 Init 2015-10-29 13:44:09 -04:00