abstract class ScodecTokenAuthenticator[A] extends TokenAuthenticator[String, A]
Token authenticator that uses Scodec encoding and then base-64 encodes the result to a String token.
- A
The result of successful authentication (ex: User, AccessToken)
- Alphabetic
- By Inheritance
- ScodecTokenAuthenticator
- TokenAuthenticator
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
- new ScodecTokenAuthenticator()
Abstract Value Members
-
abstract
def
codec: Codec[A]
A codec to encode/decode tokens
-
abstract
def
validate(a: A): AuthResult[Unit]
Validate a result.
Validate a result.
This method is called at the end of the authenticate method to ensure that any domain rules are satisfied. For example, this can be used to verify that a token hasn't expired.
- returns
an authentication failure on the left if there is an error, otherwise Unit on the right.
Concrete Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
authenticate(base64Token: String): AuthResult[A]
Decode and validate a token.
Decode and validate a token.
- base64Token
a base-64 encoded token, as returned by the serialize method.
- Definition Classes
- ScodecTokenAuthenticator → TokenAuthenticator
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- def decode(tokenBits: BitVector): AuthResult[A]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
serialize(token: A): Either[String, String]
Serialize a token.
Serialize a token.
- returns
an error message on the left if serialization fails, otherwise a base-64 endoded token on the right.
- Definition Classes
- ScodecTokenAuthenticator → TokenAuthenticator
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )