-
Notifications
You must be signed in to change notification settings - Fork 9
/
Generic.php
42 lines (35 loc) · 1008 Bytes
/
Generic.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
namespace dokuwiki\plugin\oauthgeneric;
use dokuwiki\plugin\oauth\Service\AbstractOAuth2Base;
use OAuth\Common\Http\Uri\Uri;
/**
* Custom Service for Generic oAuth
*/
class Generic extends AbstractOAuth2Base
{
/** @inheritdoc */
public function needsStateParameterInAuthUrl() {
$plugin = plugin_load('helper', 'oauthgeneric');
return 0 !== $plugin->getConf('needs-state');
}
/** @inheritdoc */
public function getAuthorizationEndpoint()
{
$plugin = plugin_load('helper', 'oauthgeneric');
return new Uri($plugin->getConf('authurl'));
}
/** @inheritdoc */
public function getAccessTokenEndpoint()
{
$plugin = plugin_load('helper', 'oauthgeneric');
return new Uri($plugin->getConf('tokenurl'));
}
/**
* @inheritdoc
*/
protected function getAuthorizationMethod()
{
$plugin = plugin_load('helper', 'oauthgeneric');
return (int) $plugin->getConf('authmethod');
}
}