1<?php
2
3namespace dokuwiki\plugin\oauthdiscord;
4
5use dokuwiki\plugin\oauth\Service\AbstractOAuth2Base;
6use OAuth\Common\Http\Uri\Uri;
7
8/**
9 * Custom Service for Discord oAuth
10 */
11class Discord extends AbstractOAuth2Base
12{
13    // Discord scopes
14    const SCOPE_EMAIL = 'email';
15    const SCOPE_IDENTIFY = 'identify';
16
17    /**
18     * @inheritdoc
19     */
20    public function getAuthorizationEndpoint()
21    {
22        return new Uri('https://discord.com/oauth2/authorize');
23    }
24
25    /**
26     * @inheritdoc
27     */
28    public function getAccessTokenEndpoint()
29    {
30        return new Uri('https://discord.com/api/oauth2/token');
31    }
32
33    /**
34     * @inheritdoc
35     */
36    protected function getAuthorizationMethod()
37    {
38        return static::AUTHORIZATION_METHOD_HEADER_BEARER;
39    }
40}
41