Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

Differences Between: [Versions 401 and 402] [Versions 401 and 403]

(no description)

File Size: 233 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: OAuthServer  - X-Ref

Class to represent an %OAuth Server

__construct($data_store)   X-Ref
No description

add_signature_method($signature_method)   X-Ref
No description

fetch_request_token(&$request)   X-Ref
process a request_token request
returns the request token on success


fetch_access_token(&$request)   X-Ref
process an access_token request
returns the access token on success


verify_request(&$request)   X-Ref
verify an api call, checks all the parameters


get_version(&$request)   X-Ref
version 1


get_signature_method($request)   X-Ref
figure out the signature with some defaults


get_consumer($request)   X-Ref
try to find the consumer for the provided request's consumer key


get_token($request, $consumer, $token_type="access")   X-Ref
try to find the token for the provided request's token key


check_signature($request, $consumer, $token)   X-Ref
all-in-one function to check the signature on a request
should guess the signature method appropriately


check_timestamp($timestamp)   X-Ref
check that the timestamp is new enough


check_nonce($consumer, $token, $nonce, $timestamp)   X-Ref
check that the nonce is not repeated