Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

Differences Between: [Versions 310 and 402] [Versions 311 and 402] [Versions 39 and 402] [Versions 400 and 402] [Versions 401 and 402]

(no description)

File Size: 234 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