SecurityDirectives

pl.iterators.stir.server.directives.SecurityDirectives
See theSecurityDirectives companion object

Provides directives for securing an inner route using the standard Http authentication headers `WWW-Authenticate` and Authorization. Most prominently, HTTP Basic authentication and OAuth 2.0 Authorization Framework as defined in RFC 2617 and RFC 6750 respectively.

See: RFC 2617. See: RFC 6750.

Attributes

Companion
object
Source
SecurityDirectives.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object SecurityDirectives.type
trait Directives
object Directives.type

Members list

Type members

Types

The result of an HTTP authentication attempt is either the user object or an HttpChallenge to present to the browser.

The result of an HTTP authentication attempt is either the user object or an HttpChallenge to present to the browser.

Attributes

Source
SecurityDirectives.scala

Value members

Concrete methods

def authenticateBasic[T](realm: String, authenticator: () => T): AuthenticationDirective[T]

Wraps the inner route with Http Basic authentication support using a given Authenticator[T]. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

Wraps the inner route with Http Basic authentication support using a given Authenticator[T]. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

Attributes

Source
SecurityDirectives.scala
def authenticateBasicAsync[T](realm: String, authenticator: () => T): AuthenticationDirective[T]

Wraps the inner route with Http Basic authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

Wraps the inner route with Http Basic authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

Attributes

Source
SecurityDirectives.scala
def authenticateBasicPF[T](realm: String, authenticator: AuthenticatorPF[T]): AuthenticationDirective[T]

A directive that wraps the inner route with Http Basic authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

A directive that wraps the inner route with Http Basic authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

Attributes

Source
SecurityDirectives.scala

A directive that wraps the inner route with Http Basic authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

A directive that wraps the inner route with Http Basic authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

Attributes

Source
SecurityDirectives.scala
def authenticateOAuth2[T](realm: String, authenticator: () => T): AuthenticationDirective[T]

A directive that wraps the inner route with OAuth2 Bearer Token authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

A directive that wraps the inner route with OAuth2 Bearer Token authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

Attributes

Source
SecurityDirectives.scala
def authenticateOAuth2Async[T](realm: String, authenticator: () => T): AuthenticationDirective[T]

A directive that wraps the inner route with OAuth2 Bearer Token authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

A directive that wraps the inner route with OAuth2 Bearer Token authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

Attributes

Source
SecurityDirectives.scala
def authenticateOAuth2PF[T](realm: String, authenticator: AuthenticatorPF[T]): AuthenticationDirective[T]

A directive that wraps the inner route with OAuth2 Bearer Token authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

A directive that wraps the inner route with OAuth2 Bearer Token authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

Attributes

Source
SecurityDirectives.scala

A directive that wraps the inner route with OAuth2 Bearer Token authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

A directive that wraps the inner route with OAuth2 Bearer Token authentication support. The given authenticator determines whether the credentials in the request are valid and, if so, which user object to supply to the inner route.

Attributes

Source
SecurityDirectives.scala

Lifts an authenticator function into a directive. The authenticator function gets passed in credentials from the Authorization header of the request. If the function returns Right(user) the user object is provided to the inner route. If the function returns Left(challenge) the request is rejected with an AuthenticationFailedRejection that contains this challenge to be added to the response.

Lifts an authenticator function into a directive. The authenticator function gets passed in credentials from the Authorization header of the request. If the function returns Right(user) the user object is provided to the inner route. If the function returns Left(challenge) the request is rejected with an AuthenticationFailedRejection that contains this challenge to be added to the response.

Attributes

Source
SecurityDirectives.scala

Lifts an authenticator function into a directive. Same as authenticateOrRejectWithChallenge but only applies the authenticator function with a certain type of credentials.

Lifts an authenticator function into a directive. Same as authenticateOrRejectWithChallenge but only applies the authenticator function with a certain type of credentials.

Attributes

Source
SecurityDirectives.scala
def authorize(check: => Boolean): Directive0

Applies the given authorization check to the request. If the check fails the route is rejected with an AuthorizationFailedRejection.

Applies the given authorization check to the request. If the check fails the route is rejected with an AuthorizationFailedRejection.

Attributes

Source
SecurityDirectives.scala

Applies the given authorization check to the request. If the check fails the route is rejected with an AuthorizationFailedRejection.

Applies the given authorization check to the request. If the check fails the route is rejected with an AuthorizationFailedRejection.

Attributes

Source
SecurityDirectives.scala
def authorizeAsync(check: => IO[Boolean]): Directive0

Asynchronous version of authorize. If the IO fails or is completed with false authorization fails and the route is rejected with an AuthorizationFailedRejection.

Asynchronous version of authorize. If the IO fails or is completed with false authorization fails and the route is rejected with an AuthorizationFailedRejection.

Attributes

Source
SecurityDirectives.scala

Asynchronous version of authorize. If the IO fails or is completed with false authorization fails and the route is rejected with an AuthorizationFailedRejection.

Asynchronous version of authorize. If the IO fails or is completed with false authorization fails and the route is rejected with an AuthorizationFailedRejection.

Attributes

Source
SecurityDirectives.scala

Extracts the potentially present Credentials provided with the request's Authorization header.

Extracts the potentially present Credentials provided with the request's Authorization header.

Attributes

Source
SecurityDirectives.scala