1<?php
2
3namespace dokuwiki\plugin\oauthauthsch;
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', 'oauthauthsch');
18        return new Uri('https://auth.sch.bme.hu/site/login'); // new Uri($plugin->getConf('authurl'));
19    }
20
21    /** @inheritdoc */
22    public function getAccessTokenEndpoint()
23    {
24        $plugin = plugin_load('helper', 'oauthauthsch');
25        return new Uri('https://auth.sch.bme.hu/oauth2/token'); //new Uri($plugin->getConf('tokenurl'));
26    }
27
28    /**
29     * @inheritdoc
30     */
31    protected function getAuthorizationMethod()
32    {
33        $plugin = plugin_load('helper', 'oauthauthsch');
34
35        return 2;  // Query String v1  // (int) $plugin->getConf('authmethod');
36    }
37}
38