File tree Expand file tree Collapse file tree 3 files changed +13
-13
lines changed
main/java/eu/webeid/security
test/java/eu/webeid/security/challenge Expand file tree Collapse file tree 3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 3131/**
3232 * A store for storing generated challenge nonces and accessing their generation time.
3333 */
34- public abstract class ChallengeNonceStore {
34+ public interface ChallengeNonceStore {
3535
36- public abstract void put (ChallengeNonce challengeNonce );
36+ void put (ChallengeNonce challengeNonce );
3737
38- public final ChallengeNonce getAndRemove () throws AuthTokenException {
38+ ChallengeNonce getAndRemoveImpl ();
39+
40+ default ChallengeNonce getAndRemove () throws AuthTokenException {
3941 final ChallengeNonce challengeNonce = getAndRemoveImpl ();
4042 if (challengeNonce == null ) {
4143 throw new ChallengeNonceNotFoundException ();
@@ -46,6 +48,4 @@ public final ChallengeNonce getAndRemove() throws AuthTokenException {
4648 return challengeNonce ;
4749 }
4850
49- protected abstract ChallengeNonce getAndRemoveImpl ();
50-
5151}
Original file line number Diff line number Diff line change 2828public class AuthTokenSignatureValidationException extends AuthTokenException {
2929
3030 public AuthTokenSignatureValidationException () {
31- super ("Token signature validation has failed" );
31+ super ("Token signature validation has failed. Check that the origin and nonce are correct. " );
3232 }
3333
3434}
Original file line number Diff line number Diff line change 2222
2323package eu .webeid .security .challenge ;
2424
25- public class InMemoryChallengeNonceStore extends ChallengeNonceStore {
25+ public class InMemoryChallengeNonceStore implements ChallengeNonceStore {
2626
2727 private ChallengeNonce challengeNonce ;
2828
2929 @ Override
30- protected ChallengeNonce getAndRemoveImpl () {
31- final ChallengeNonce result = challengeNonce ;
32- challengeNonce = null ;
33- return result ;
30+ public void put (ChallengeNonce challengeNonce ) {
31+ this .challengeNonce = challengeNonce ;
3432 }
3533
3634 @ Override
37- public void put (ChallengeNonce challengeNonce ) {
38- this .challengeNonce = challengeNonce ;
35+ public ChallengeNonce getAndRemoveImpl () {
36+ final ChallengeNonce result = challengeNonce ;
37+ challengeNonce = null ;
38+ return result ;
3939 }
4040
4141}
You can’t perform that action at this time.
0 commit comments