playframework/Play20 — comment on commit 011713a8b631404d03295e1e9fa78178fb45868f
File: framework/play/src/main/scala/play/api/mvc/Addons.scala line 6
By julienrf:

What about that:
```
/**
* @tparam A Type of the authentification object
*/
trait SecurityLike[A] {
def AUTH_KEY: String // Key of the authentification object stored in the session
def Authenticated[B] …
}
```
And of course you would keep the default `Security` object:
```
object Security extends SecurityLike[String] {
val AUTH_KEY = "username"
…
}
```
The `SecurityLike` trait would allow to define custom authentification object, e.g. for OAuth authentification you would write:
```
trait OAuthSecurity extends SecurityLike[RequestToken] {
val AUTH_KEY = "token"
}
```