Skip to content

Commit

Permalink
#25 Add API key authentication type
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Nov 20, 2017
1 parent e9f62c8 commit 6aa9bba
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions app/org/elastic4play/controllers/Authenticated.scala
Original file line number Diff line number Diff line change
Expand Up @@ -193,34 +193,6 @@ class Authenticated(
}
}

/**
* Get user in session -orElse- get user from key parameter
*/
def getContext(request: RequestHeader): Future[AuthContext] =
getFromSession(request).recoverWith {
case getFromSessionError
getFromApiKey(request).recoverWith {
case getFromApiKeyError
getFromBasicAuth(request).recoverWith {
case getFromBasicAuthError
getFromClientCertificate(request).recoverWith {
case getFromClientCertificateError
userSrv.getInitialUser(request).recoverWith {
case getInitialUserError
logger.error(
s"""Authentication error:
| From session : ${getFromSessionError.getClass.getSimpleName} ${getFromSessionError.getMessage}
| From api key : ${getFromApiKeyError.getClass.getSimpleName} ${getFromApiKeyError.getMessage}
| From basic auth: ${getFromBasicAuthError.getClass.getSimpleName} ${getFromBasicAuthError.getMessage}
| From cert auth : ${getFromClientCertificateError.getClass.getSimpleName} ${getFromClientCertificateError.getMessage}
| Initial user : ${getInitialUserError.getClass.getSimpleName} ${getInitialUserError.getMessage}
""".stripMargin)
Future.failed(AuthenticationError("Not authenticated"))
}
}
}
}
}
val authenticationMethods =
(if (authBySessionCookie) Seq("session" getFromSession _) else Nil) ++
(if (authByPki) Seq("pki" getFromClientCertificate _) else Nil) ++
Expand Down

0 comments on commit 6aa9bba

Please sign in to comment.