Documentation

Bearer extends AbstractAuth
in package

HTTP Bearer authentication utility.

This class helps you setup bearer auth. The process is fairly simple:

  1. Instantiate the class.
  2. Call getToken (this will return null or a token as string)
  3. If you didn't get a valid token, call 'requireLogin'
Tags
copyright

Copyright (C) fruux GmbH (https://fruux.com/)

author

François Kooman (fkooman@tuxed.net)

license

http://sabre.io/license/ Modified BSD License

Table of Contents

$realm  : string
Authentication realm.
$request  : RequestInterface
Request object.
$response  : ResponseInterface
Response object.
__construct()  : mixed
Creates the object.
getRealm()  : string
Returns the HTTP realm.
getToken()  : string|null
This method returns a string with an access token.
requireLogin()  : mixed
This method sends the needed HTTP header and statuscode (401) to force authentication.

Properties

Methods

getRealm()

Returns the HTTP realm.

public getRealm() : string
Return values
string

getToken()

This method returns a string with an access token.

public getToken() : string|null

If no token was found, this method returns null.

Return values
string|null

requireLogin()

This method sends the needed HTTP header and statuscode (401) to force authentication.

public requireLogin() : mixed
Return values
mixed

Search results