1<?php 2 3namespace dokuwiki\plugin\oauthcognito; 4 5use dokuwiki\plugin\oauth\Service\AbstractOAuth2Base; 6use OAuth\Common\Http\Uri\Uri; 7 8/** 9 * Custom Service for Amazon Cognito 10 */ 11class Cognito extends AbstractOAuth2Base 12{ 13 14 /** @inheritdoc */ 15 public function getAuthorizationEndpoint() 16 { 17 $plugin = plugin_load('action', 'oauthcognito'); 18 return new Uri($plugin->getConf('baseurl') . '/oauth2/authorize'); 19 } 20 21 /** @inheritdoc */ 22 public function getAccessTokenEndpoint() 23 { 24 $plugin = plugin_load('action', 'oauthcognito'); 25 return new Uri($plugin->getConf('baseurl') . '/oauth2/token'); 26 } 27 28 /** 29 * @inheritdoc 30 */ 31 protected function getAuthorizationMethod() 32 { 33 return static::AUTHORIZATION_METHOD_HEADER_BEARER; 34 } 35} 36