File tree 3 files changed +13
-13
lines changed
main/java/eu/webeid/security
test/java/eu/webeid/security/challenge
3 files changed +13
-13
lines changed Original file line number Diff line number Diff line change 31
31
/**
32
32
* A store for storing generated challenge nonces and accessing their generation time.
33
33
*/
34
- public abstract class ChallengeNonceStore {
34
+ public interface ChallengeNonceStore {
35
35
36
- public abstract void put (ChallengeNonce challengeNonce );
36
+ void put (ChallengeNonce challengeNonce );
37
37
38
- public final ChallengeNonce getAndRemove () throws AuthTokenException {
38
+ ChallengeNonce getAndRemoveImpl ();
39
+
40
+ default ChallengeNonce getAndRemove () throws AuthTokenException {
39
41
final ChallengeNonce challengeNonce = getAndRemoveImpl ();
40
42
if (challengeNonce == null ) {
41
43
throw new ChallengeNonceNotFoundException ();
@@ -46,6 +48,4 @@ public final ChallengeNonce getAndRemove() throws AuthTokenException {
46
48
return challengeNonce ;
47
49
}
48
50
49
- protected abstract ChallengeNonce getAndRemoveImpl ();
50
-
51
51
}
Original file line number Diff line number Diff line change 28
28
public class AuthTokenSignatureValidationException extends AuthTokenException {
29
29
30
30
public AuthTokenSignatureValidationException () {
31
- super ("Token signature validation has failed" );
31
+ super ("Token signature validation has failed. Check that the origin and nonce are correct. " );
32
32
}
33
33
34
34
}
Original file line number Diff line number Diff line change 22
22
23
23
package eu .webeid .security .challenge ;
24
24
25
- public class InMemoryChallengeNonceStore extends ChallengeNonceStore {
25
+ public class InMemoryChallengeNonceStore implements ChallengeNonceStore {
26
26
27
27
private ChallengeNonce challengeNonce ;
28
28
29
29
@ 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 ;
34
32
}
35
33
36
34
@ 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 ;
39
39
}
40
40
41
41
}
You can’t perform that action at this time.
0 commit comments