VuFind API Documentation

OauthServiceTrait

Helper trait for OAuth 2.0 connections.

Classes which use this trait should also use LoggerAwareTrait.

Closely adapted from VuFind\DigitalContent\OverdriveConnector.

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

author

Brent Palmer brent-palmer@icpl.org

author

Maccabee Levine msl321@lehigh.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link
https://vufind.org

Table of Contents

$tokenData  : stdClass
Current OAuth token
authenticateWithClientCredentials()  : stdClass|bool
Authenticate via the OAuth Client Credentials grant type.
oauthServiceTraitDebug()  : void
Log a debug message, if $this->log exists.
oauthServiceTraitError()  : void
Log an error message, if $this->log exists.
oauthServiceTraitLog()  : void
Log a message, if $this->log exists.

Properties

Methods

authenticateWithClientCredentials()

Authenticate via the OAuth Client Credentials grant type.

public authenticateWithClientCredentials(string $oauthUrl, string $clientId, string $clientSecret) : stdClass|bool
Parameters
$oauthUrl : string

URL of thee OAuth service

$clientId : string

client_id for a client_credentials grant

$clientSecret : string

client_secret for a client_credentials grant

Tags
link
https://www.oauth.com/oauth2-servers/access-tokens/client-credentials/
Return values
stdClass|bool

token for the session or false if the token request failed

oauthServiceTraitDebug()

Log a debug message, if $this->log exists.

protected oauthServiceTraitDebug(string $msg) : void
Parameters
$msg : string

Log message

Return values
void

oauthServiceTraitError()

Log an error message, if $this->log exists.

protected oauthServiceTraitError(string $msg) : void
Parameters
$msg : string

Log message

Return values
void

oauthServiceTraitLog()

Log a message, if $this->log exists.

protected oauthServiceTraitLog(string $level, string $msg) : void
Parameters
$level : string

Logging level

$msg : string

Log message

Return values
void

Search results