|
| static | detect ($request_type=null, $request_body=null) |
| |
| static | getServer () |
| |
| static | getOAuthId ($user_id) |
| |
| static | detect () |
| |
| static | addType ($type, $class) |
| |
| static | removeType ($type) |
| |
| static | find ($id) |
| |
| static | findAll () |
| |
| static | create ($type) |
| |
| static | detectConsumer ($type=null, $request_type=null, $request_body=null) |
| |
| static | expireTableScheme () |
| |
| static | find ($id) |
| |
| static | exists ($id) |
| |
| static | countBySql ($sql=1, $params=array()) |
| |
| static | create ($data) |
| |
| static | build ($data, $is_new=true) |
| |
| static | buildExisting ($data) |
| |
| static | import ($data) |
| |
| static | findBySQL ($sql, $params=array()) |
| |
| static | findByObject (SimpleORMap $object) |
| |
| static | findOneBySQL ($where, $params=array()) |
| |
| static | findThru ($foreign_key_value, $options) |
| |
| static | findEachBySQL ($callable, $sql, $params=array()) |
| |
| static | findMany ($pks=array(), $order='', $order_params=array()) |
| |
| static | findEachMany ($callable, $pks=array(), $order='', $order_params=array()) |
| |
| static | findAndMapBySQL ($callable, $where, $params=array()) |
| |
| static | findAndMapMany ($callable, $pks=array(), $order='', $order_params=array()) |
| |
| static | deleteBySQL ($where, $params=array()) |
| |
| static | toObject ($id_or_object) |
| |
| static | __callStatic ($name, $arguments) |
| |
OAuth consumer for the rest api
- Author
- Jan-Hendrik Willms tleil.nosp@m.ax+s.nosp@m.tudip.nosp@m.@gma.nosp@m.il.co.nosp@m.m @license GPL 2 or later
- Since
- Stud.IP 3.0
◆ __construct()
| __construct |
( |
|
$id = null | ) |
|
◆ before_store()
"Before store" trigger. Creates a clone of the consumer in the tables for the vendor oauth library.
◆ configure()
| static configure |
( |
|
$config = array() | ) |
|
|
staticprotected |
Configures the model.
- Parameters
-
| array | $config | Configuration array |
Reimplemented from Base.
◆ detect()
| static detect |
( |
|
$request_type = null, |
|
|
|
$request_body = null |
|
) |
| |
|
static |
Detects whether the request is authenticated via OAuth.
- Parameters
-
| mixed | $request_type | Type of request (optional; defaults to any) |
| mixed | $request_body | Request body to use (optional, should be removed when Stud.IP requires PHP >= 5.6) |
- Returns
- mixed Instance of self if authentication was detected, false otherwise
◆ getOAuthId()
| static getOAuthId |
( |
|
$user_id | ) |
|
|
static |
Maps a user to an oauth id. This is neccessary due to the fact that the oauth lib works with different ids than Stud.IP.
- Parameters
-
| String | $user_id | Id of the user to get an oauth id for |
- Returns
- String The mapped oauth id
◆ getServer()
Returns a singleton instance of the oauth server.
- Returns
- OAuthServer The server object
◆ grantAccess()
| grantAccess |
( |
|
$user_id = null | ) |
|
Grant oauth access for a user.
- Parameters
-
| mixed | $user_id | Specific user id or null to default to the injected user |
- Exceptions
-
| Exception | If no valid user is present |
◆ revokeAccess()
| revokeAccess |
( |
|
$user_id = null | ) |
|
Revoke oauth access from a user.
- Parameters
-
| mixed | $user_id | Specific user id or null to default to the injected user |
- Exceptions
-
| Exception | If no valid user is present |
The documentation for this class was generated from the following file: