Stud.IP  6.1
OAuth1 Class Reference

Static Public Member Functions

static signRequest (Request $request, string $consumerSecret, string $tokenSecret, string $method)
 
static verifyRequest (Request $request, string $consumerSecret, string $tokenSecret)
 
static extractParameters (Request $request)
 
static getSignatureBaseString (Request $request)
 
static hash (string $method, string $text, string $key)
 
static urldecode (string $input)
 
static urlencode (string $input)
 

Detailed Description

Basic oauth1 request handling for Stud.IP using PSR-7 http messages.

Author
Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m GPL2 or any later version
Since
Stud.IP 6.0

Member Function Documentation

◆ extractParameters()

static extractParameters ( Request  $request)
static

Extracts the oauth parameters either from the Authorization header or from the query string.

◆ getSignatureBaseString()

static getSignatureBaseString ( Request  $request)
static

Creates the base string for the signature. It consists of:

  • The uppercase request method
  • The request URL
  • the sorted and urlencoded parameters of the request

The urlencoded parts are concatenated together into a single string separated by the '&' character.

◆ hash()

static hash ( string  $method,
string  $text,
string  $key 
)
static

Hashes a given text with a given key by the given method.

Exceptions
RuntimeExceptionif the given hash method is not supported

◆ signRequest()

static signRequest ( Request  $request,
string  $consumerSecret,
string  $tokenSecret,
string  $method 
)
static

Signs a given request.

Exceptions
RuntimeExceptionif a request for any other oauth version then 1.0 shall be signed

◆ urldecode()

static urldecode ( string  $input)
static

Urlencodes a given input

◆ urlencode()

static urlencode ( string  $input)
static

Urldecodes a given input

◆ verifyRequest()

static verifyRequest ( Request  $request,
string  $consumerSecret,
string  $tokenSecret 
)
static

Verifies an oauth request.

Exceptions
RuntimeExceptionif any necessary oauth parameter is missing

The documentation for this class was generated from the following file: