mirror of
https://github.com/anikeen-com/id.git
synced 2026-03-13 13:46:13 +00:00
14
oauth-public.staging.key
Normal file
14
oauth-public.staging.key
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
-----BEGIN PUBLIC KEY-----
|
||||||
|
MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAi4Ta8r01zKaGSnGi1EiD
|
||||||
|
uMFWRXBlK4y/ZIfWBpElmS2ygv4mGeP3hT4Flm696Z2UMy56KC+c7CC/PQCiutLk
|
||||||
|
5NUphyX/t+0QS5Dqpw6FB33fLTNNY7GqSmGIUE4os8XYZRSyDQRgtOgq3R3vJkoV
|
||||||
|
7zoavTJmSCQlG5Qf0T//iMmzQ+b+6VZm1CJSz5nGx94u1DuXNyP5Epkk0wuHrtwy
|
||||||
|
kADR2lmydNodJzqpSD+8yQqnAhOZNtNF4qwQ3g13fRvHycBp3G2nlCfOn2g5PmYD
|
||||||
|
KYBKqvTq4PQH4E+K3pbbMz6zf/T6Dw7zTfksqHR4hqMgN6byRRxmwuBczIumcu9b
|
||||||
|
y7xbgoIGIVZXgJliALPFi+zTPTN7c8MedFs/xCBHCmzWYTCZfHgr8RPRewD19tCG
|
||||||
|
NSny5R0vlArpuZCTTgedPESDeGU4eNEddg4yXFzKlpE2nNuvzZ1Ohruc5ETOSU19
|
||||||
|
RTCBUBkjeL6ESZRd/yKGjbVx4dEYxZdIz4yBl+hZ2ZOIyG7L3zPrccAWrPpG56xr
|
||||||
|
E5IDBXxLFhaJ5LlyEAGQehB0ShEuCdkr88Xz7ba9PHpGqY83l4//ULrqPIZPAa4Z
|
||||||
|
E3AWHT1ZtXNPeA4SzZ9Y9Oij4M3chyHxqM0lL3kYP+dstZehTujStfElDIx2Ni10
|
||||||
|
73tILu4edYS0FxsL19m8gbsCAwEAAQ==
|
||||||
|
-----END PUBLIC KEY-----
|
||||||
@@ -66,6 +66,11 @@ class AnikeenId
|
|||||||
*/
|
*/
|
||||||
private static string $refreshTokenField = 'anikeen_id_refresh_token';
|
private static string $refreshTokenField = 'anikeen_id_refresh_token';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Anikeen ID environment mode.
|
||||||
|
*/
|
||||||
|
protected static ?string $mode = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Guzzle is used to make http requests.
|
* Guzzle is used to make http requests.
|
||||||
*/
|
*/
|
||||||
@@ -110,7 +115,7 @@ class AnikeenId
|
|||||||
if ($redirectUri = config('services.anikeen.redirect')) {
|
if ($redirectUri = config('services.anikeen.redirect')) {
|
||||||
$this->setRedirectUri($redirectUri);
|
$this->setRedirectUri($redirectUri);
|
||||||
}
|
}
|
||||||
if (config('services.anikeen.mode') === 'staging') {
|
if (self::getMode() === 'staging') {
|
||||||
self::setBaseUrl(self::$stagingBaseUrl);
|
self::setBaseUrl(self::$stagingBaseUrl);
|
||||||
}
|
}
|
||||||
if ($baseUrl = config('services.anikeen.base_url')) {
|
if ($baseUrl = config('services.anikeen.base_url')) {
|
||||||
@@ -141,6 +146,11 @@ class AnikeenId
|
|||||||
return self::$accessTokenField;
|
return self::$accessTokenField;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getMode(): string
|
||||||
|
{
|
||||||
|
return config('services.anikeen.mode', 'production');
|
||||||
|
}
|
||||||
|
|
||||||
public static function useRefreshTokenField(string $refreshTokenField): void
|
public static function useRefreshTokenField(string $refreshTokenField): void
|
||||||
{
|
{
|
||||||
self::$refreshTokenField = $refreshTokenField;
|
self::$refreshTokenField = $refreshTokenField;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Anikeen\Id\Helpers;
|
namespace Anikeen\Id\Helpers;
|
||||||
|
|
||||||
|
use Anikeen\Id\AnikeenId;
|
||||||
use Firebase\JWT\JWT;
|
use Firebase\JWT\JWT;
|
||||||
use Firebase\JWT\Key;
|
use Firebase\JWT\Key;
|
||||||
use Illuminate\Auth\AuthenticationException;
|
use Illuminate\Auth\AuthenticationException;
|
||||||
@@ -30,6 +31,8 @@ class JwtParser
|
|||||||
|
|
||||||
private function getOauthPublicKey(): bool|string
|
private function getOauthPublicKey(): bool|string
|
||||||
{
|
{
|
||||||
return file_get_contents(dirname(__DIR__, 3) . '/oauth-public.key');
|
return AnikeenId::getMode() === 'staging'
|
||||||
|
? file_get_contents(dirname(__DIR__, 3) . '/oauth-public.staging.key')
|
||||||
|
: file_get_contents(dirname(__DIR__, 3) . '/oauth-public.key');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace Anikeen\Id\Socialite;
|
namespace Anikeen\Id\Socialite;
|
||||||
|
|
||||||
|
use Anikeen\Id\AnikeenId;
|
||||||
use Anikeen\Id\Enums\Scope;
|
use Anikeen\Id\Enums\Scope;
|
||||||
use GuzzleHttp\Exception\GuzzleException;
|
use GuzzleHttp\Exception\GuzzleException;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
@@ -32,9 +33,7 @@ class Provider extends AbstractProvider implements ProviderInterface
|
|||||||
*/
|
*/
|
||||||
protected function getBaseUrl(): string
|
protected function getBaseUrl(): string
|
||||||
{
|
{
|
||||||
$mode = config('services.anikeen.mode') ?? 'production';
|
return AnikeenId::getMode() === 'staging'
|
||||||
|
|
||||||
return $mode === 'staging'
|
|
||||||
? 'https://staging.id.anikeen.com'
|
? 'https://staging.id.anikeen.com'
|
||||||
: 'https://id.anikeen.com';
|
: 'https://id.anikeen.com';
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user