Add token-based authentication (without rejection handling)

This commit is contained in:
2020-09-19 11:37:42 +02:00
parent 31cb22035b
commit f21d077522
10 changed files with 178 additions and 35 deletions

View File

@ -15,14 +15,14 @@ public final class HandshakeRejection extends Event<String> {
/**
* Select this value if a given password hash or user name was incorrect.
*
*
* @since Envoy Common v0.3-alpha
*/
public static final String WRONG_PASSWORD_OR_USER = "Incorrect user name or password.";
/**
* Select this value if a given user name for a registration is already taken.
*
*
* @since Envoy Common v0.1-beta
*/
public static final String USERNAME_TAKEN = "Incorrect user name or password.";
@ -30,15 +30,22 @@ public final class HandshakeRejection extends Event<String> {
/**
* Select this value if the version of the client is incompatible with the
* server.
*
*
* @since Envoy Common v0.1-beta
*/
public static final String WRONG_VERSION = "Incompatible client version";
/**
* Select this value if the client provided an invalid authentication token.
*
* @since Envoy Common v0.2-beta
*/
public static final String INVALID_TOKEN = "Invalid authentication token";
/**
* Select this value if the handshake could not be completed for some different
* reason.
*
*
* @since Envoy Common v0.3-alpha
*/
public static final String INTERNAL_ERROR = "An internal error occured.";

View File

@ -0,0 +1,26 @@
package envoy.event;
/**
* This event can be used to transmit a new authentication token to a client.
* <p>
* Project: <strong>envoy-common</strong><br>
* File: <strong>NewAuthToken.java</strong><br>
* Created: <strong>19.09.2020</strong><br>
*
* @author Kai S. K. Engelbart
* @since Envoy Common v0.2-beta
*/
public class NewAuthToken extends Event<String> {
private static final long serialVersionUID = 0L;
/**
* Constructs a new authentication token event.
*
* @param token the token to transmit
* @since Envoy Common v0.2-beta
*/
public NewAuthToken(String token) {
super(token);
}
}