Skip to content
This repository was archived by the owner on Jul 8, 2022. It is now read-only.

Commit e3b9dc7

Browse files
feat: update url for ATLauncher oauth base
1 parent fdb4d05 commit e3b9dc7

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

classes/ATLauncherAdapter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function getUser() {
1717
$JSON = new \JSON(JSON_LOOSE_TYPE);
1818
$data = array();
1919

20-
$response = $this->oAuth->request('/oauth/me');
20+
$response = $this->oAuth->request('https://atlauncher.com/admin/oauth/me');
2121
$result = $JSON->decode($response);
2222

2323
if( !empty($result['username']) )

conf/default.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
* @author Andreas Gohr <andi@splitbrain.org>
66
*/
77

8-
$conf['client-key'] = '';
9-
$conf['client-secret'] = '';
10-
$conf['register-on-auth'] = 0;
8+
$conf['client-key'] = '';
9+
$conf['client-secret'] = '';
10+
$conf['register-on-auth'] = 0;

conf/metadata.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function html(&$plugin, $echo = false) {
2525

2626
}
2727

28-
$meta['info'] = array('plugin_oauthatlauncher');
29-
$meta['client-key'] = array('string');
30-
$meta['client-secret'] = array('string');
31-
$meta['register-on-auth'] = array('onoff','_caution' => 'security');
28+
$meta['info'] = array('plugin_oauthatlauncher');
29+
$meta['client-key'] = array('string');
30+
$meta['client-secret'] = array('string');
31+
$meta['register-on-auth'] = array('onoff','_caution' => 'security');

helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public function loadService(&$servicename) {
4242

4343
// The generic service can be externally configured
4444
if(is_a($service->oAuth, 'OAuth\\OAuth2\\Service\\Generic')) {
45-
$service->oAuth->setAuthorizationEndpoint("https://admin.atlauncher.com/oauth/authorize");
46-
$service->oAuth->setAccessTokenEndpoint("https://admin.atlauncher.com/oauth/access_token");
45+
$service->oAuth->setAuthorizationEndpoint("https://atlauncher.com/admin/oauth/authorize");
46+
$service->oAuth->setAccessTokenEndpoint("https://atlauncher.com/admin/oauth/token");
4747
}
4848

4949
return $service;

phpoauthlib/src/OAuth/OAuth2/Service/ATLauncher.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(
2626
parent::__construct($credentials, $httpClient, $storage, $scopes, $baseApiUri);
2727

2828
if (null === $baseApiUri) {
29-
$this->baseApiUri = new Uri('https://admin.atlauncher.com/');
29+
$this->baseApiUri = new Uri('https://atlauncher.com/admin/oauth');
3030
}
3131
}
3232

@@ -35,23 +35,23 @@ public function __construct(
3535
*/
3636
protected function getAuthorizationMethod()
3737
{
38-
return static::AUTHORIZATION_METHOD_QUERY_STRING;
38+
return static::AUTHORIZATION_METHOD_HEADER_BEARER;
3939
}
4040

4141
/**
4242
* {@inheritdoc}
4343
*/
4444
public function getAuthorizationEndpoint()
4545
{
46-
return new Uri('https://admin.atlauncher.com/oauth/authorize');
46+
return new Uri('https://atlauncher.com/admin/oauth/authorize');
4747
}
4848

4949
/**
5050
* {@inheritdoc}
5151
*/
5252
public function getAccessTokenEndpoint()
5353
{
54-
return new Uri('https://admin.atlauncher.com/oauth/access_token');
54+
return new Uri('https://atlauncher.com/admin/oauth/token');
5555
}
5656

5757
/**
@@ -70,8 +70,8 @@ protected function parseAccessTokenResponse($responseBody)
7070
$token = new StdOAuth2Token();
7171
$token->setAccessToken($data['access_token']);
7272

73-
if (isset($data['expires'])) {
74-
$token->setLifeTime($data['expires']);
73+
if (isset($data['expires_in'])) {
74+
$token->setLifeTime($data['expires_in']);
7575
}
7676

7777
if (isset($data['refresh_token'])) {
@@ -80,7 +80,7 @@ protected function parseAccessTokenResponse($responseBody)
8080
}
8181

8282
unset($data['access_token']);
83-
unset($data['expires']);
83+
unset($data['expires_in']);
8484

8585
$token->setExtraParams($data);
8686

0 commit comments

Comments
 (0)