Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feedback #1

Open
wants to merge 36 commits into
base: feedback
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
341ddfc
Setting up GitHub Classroom Feedback
github-classroom[bot] Feb 19, 2021
33e3e31
first commit cloudflare
Mar 2, 2021
bc14573
Add jwt token
Mar 5, 2021
f62174f
jwt Public Key error
Mar 8, 2021
f26597f
jwk error with publick keys
Mar 8, 2021
4f2e3c9
jwt debug
Mar 8, 2021
fa31840
jwk debug
Mar 9, 2021
624191b
Update mock keys
gsomoza Mar 9, 2021
51764a9
Update keys to match
gsomoza Mar 9, 2021
6c30762
jwk progress
Mar 9, 2021
46a6472
add curl
Mar 11, 2021
53d02f6
refactor
Mar 11, 2021
6893bff
add TokenValidator Service
Mar 15, 2021
e382df8
Refactor
Mar 18, 2021
2144619
Refactor 2
mparatcha Mar 18, 2021
820d8c0
fix bug aroundDispatch
mparatcha Mar 19, 2021
27e0d98
first unit test
mparatcha Mar 29, 2021
38e26c8
Refactor for unit tests
gsomoza Mar 29, 2021
63d6094
test getPublicKeys
mparatcha Mar 31, 2021
f4e64f2
add setup to TokenValidationTest class
mparatcha Apr 6, 2021
01587fd
add Admin Controller
mparatcha Apr 12, 2021
2618507
Fix admin controller
gsomoza Apr 12, 2021
5b8fba9
Add layout
mparatcha Apr 15, 2021
e492dba
insert button in admin login page
gsomoza Apr 15, 2021
f2686d8
add cloudflare btn to admin login
mparatcha Apr 20, 2021
b05a5aa
fix component registration & template folder name
gsomoza Apr 22, 2021
1f5beaa
fix index controller so that something happens in every case
gsomoza Apr 22, 2021
f0f1fa3
fix private key formatting
gsomoza Apr 22, 2021
8714f24
LoginByCloudflareEmailService - add authentication
mparatcha May 3, 2021
01b2c87
add some fix
mparatcha May 7, 2021
5ced563
add more fix
mparatcha May 7, 2021
b24598f
add getUrl functionality
mparatcha May 11, 2021
9c04907
Add fixes
mparatcha May 19, 2021
fe3815f
Add functionality to cloudflare login button
mparatcha Jun 29, 2021
489fa19
last commit
mparatcha Jul 8, 2021
d524ec0
Add TokenValidatorInterface
mparatcha Jul 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add getUrl functionality
mparatcha committed May 11, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b24598f0fe390d07885a2a3cf575117790e71aaa
14 changes: 6 additions & 8 deletions src/Controller/Adminhtml/Index/Index.php
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
use Magento\Framework\App\Action\Context;
use Magento\Framework\App\Action\HttpGetActionInterface;
use Plus54\CloudFlareAccess\Service\LoginByCloudflareEmailService;
use Plus54\CloudFlareAccess\Service\LoginByCloudflareException;
use Plus54\CloudFlareAccess\Service\TokenValidator;

class Index implements HttpGetActionInterface
@@ -41,7 +42,7 @@ public function execute()

//}

die('here');

// servicio => buscar y loguear al usuario que tiene el mismo email que el JWT token

/* if ($validatedToken->iss !== "example.edu") {
@@ -53,14 +54,11 @@ public function execute()
// catch LoginByCloudflareException
// => set message
// => redirect back to login page
} catch (\LoginByCoudflareException $e) {
throw new \Exception(__('The user cannot login by Cloudflare properly'),0,$e);
$backendUrl = $this->getUrl('index');
return $this->getRedirect($backendUrl);
} catch (\Exception $e) {
die('error');
// mostrar el mensaje de error en el frontend, usando "message manager"
} catch (LoginByCloudflareException $e) {
throw new \Exception(__('The user cannot login by Cloudflare properly'), 0, $e);
}
$backendUrl = $this->getUrl('index');
return $this->getRedirect($backendUrl);
}

public function getRequest()