1<?php
2
3namespace dokuwiki\plugin\oauthgeneric;
4
5use dokuwiki\plugin\oauth\Service\AbstractOAuth2Base;
6use OAuth\Common\Http\Uri\Uri;
7
8/**
9 * Custom Service for Generic oAuth
10 */
11class Generic extends AbstractOAuth2Base
12{
13
14    /** @inheritdoc */
15    public function getAuthorizationEndpoint()
16    {
17        $plugin = plugin_load('helper', 'oauthgeneric');
18        return new Uri($plugin->getConf('authurl'));
19    }
20
21    /** @inheritdoc */
22    public function getAccessTokenEndpoint()
23    {
24        $plugin = plugin_load('helper', 'oauthgeneric');
25        return new Uri($plugin->getConf('tokenurl'));
26    }
27
28    /**
29     * @inheritdoc
30     */
31    protected function getAuthorizationMethod()
32    {
33        $plugin = plugin_load('helper', 'oauthgeneric');
34
35        return (int) $plugin->getConf('authmethod');
36    }
37}
38