Skip to content

Commit c28ce2c

Browse files
committed
OXDEV-9880 Create basic skeleton
1 parent 499e64a commit c28ce2c

4 files changed

Lines changed: 75 additions & 1 deletion

File tree

composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@
3030
"codeception/module-webdriver": "*",
3131
"oxid-esales/codeception-modules": "dev-b-7.4.x",
3232
"oxid-esales/codeception-page-objects": "dev-b-7.4.x",
33-
"mikey179/vfsstream": "^1.6"
33+
"mikey179/vfsstream": "^1.6",
34+
"pragmarx/google2fa": "^v8.0.3",
35+
"bacon/bacon-qr-code": "v3.0.1",
36+
"league/oauth2-google": "4.0.1",
37+
"league/oauth2-facebook": "2.2.0"
3438
},
3539
"minimum-stability": "dev",
3640
"prefer-stable": true,
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
3+
namespace OxidEsales\SecurityModule\Authentication\OAuth2\Service\Provider;
4+
5+
use League\OAuth2\Client\Provider\AbstractProvider;
6+
use League\OAuth2\Client\Token\AccessTokenInterface;
7+
8+
interface ProviderInterface
9+
{
10+
/**
11+
* Get the unique identifier of the provider (e.g., 'google', 'facebook').
12+
*/
13+
public function getName(): string;
14+
15+
/**
16+
* Get the underlying OAuth2 client (League provider instance).
17+
*/
18+
public function getClient(): AbstractProvider;
19+
20+
/**
21+
* Get the authorization URL to redirect the user for login/consent.
22+
*
23+
* @param string $state Random CSRF prevention token.
24+
*/
25+
public function getAuthorizationUrl(string $state): string;
26+
27+
/**
28+
* Exchange the authorization code for an access token.
29+
*/
30+
public function getAccessToken(string $code): AccessTokenInterface;
31+
32+
/**
33+
* Fetch user information (claims) from the provider using the access token.
34+
* Should return standardized data: id, email, name, avatar, etc.
35+
*/
36+
public function getUserInfo(AccessTokenInterface $token): array;
37+
38+
/**
39+
* Validate the provider response.
40+
*/
41+
public function validateToken(AccessTokenInterface $token): bool;
42+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
/**
4+
* Copyright © OXID eSales AG. All rights reserved.
5+
* See LICENSE file for license details.
6+
*/
7+
8+
namespace OxidEsales\SecurityModule\Authentication\OAuth2\Service;
9+
10+
interface ProviderCollectorInterface
11+
{
12+
public function getProviders(): iterable;
13+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
/**
4+
* Copyright © OXID eSales AG. All rights reserved.
5+
* See LICENSE file for license details.
6+
*/
7+
8+
namespace OxidEsales\SecurityModule\Authentication\TwoFactorAuth\Service;
9+
10+
interface TwoFactorAuthInterface
11+
{
12+
public function generateQRCode(string $username): string;
13+
14+
public function generateOTPCode(): int;
15+
}

0 commit comments

Comments
 (0)