Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Nov 18, 2019
1 parent e180014 commit fdccd59
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 31 deletions.
15 changes: 10 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
{
"name": "drupol/eulogin-bundle",
"type": "symfony-bundle",
"description": "TODO",
"description": "A bundle for Symfony 4 providing authentication against European Commission authentication service.",
"license": "MIT",
"require": {
"php": ">= 7.1.3",
"ext-json": "*",
"ext-simplexml": "*",
"drupol/cas-bundle": "dev-master",
"nyholm/psr7": "^1",
"symfony/framework-bundle": "^4",
"symfony/http-client": "^4",
"symfony/psr-http-message-bridge": "^1.2",
"symfony/security-bundle": "^4",
"ext-json": "*"
"symfony/security-bundle": "^4"
},
"require-dev": {
"drupol/php-conventions": "^1"
},
"suggest": {
"monolog/monolog": "For a logger implementation (PSR-3).",
"nyholm/psr7": "For a super lightweight PSR-7/17 implementation",
"nyholm/psr7-server": "For a PSR-7 implementation of Server Requests.",
"symfony/cache": "For a cache implementation (PSR-6).",
"symfony/http-client": "For an HTTP client implementation (PSR-18)."
},
"autoload": {
"psr-4": {
"drupol\\EuloginBundle\\": "src/"
Expand Down
38 changes: 15 additions & 23 deletions src/Protocol/Eulogin.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final class Eulogin implements CasInterface
* Eulogin constructor.
*
* @param \Psr\Http\Message\ServerRequestInterface $serverRequest
* @param array $properties
* @param \drupol\psrcas\Configuration\PropertiesInterface $properties
* @param \Psr\Http\Client\ClientInterface $client
* @param \Psr\Http\Message\UriFactoryInterface $uriFactory
* @param \Psr\Http\Message\ResponseFactoryInterface $responseFactory
Expand Down Expand Up @@ -90,9 +90,20 @@ public function getProperties(): PropertiesInterface
/**
* {@inheritdoc}
*/
public function getUser(ResponseInterface $response): ?array
{
return $this->cas->getUser($response);
public function handleProxyCallback(
array $parameters = [],
?ResponseInterface $response = null
): ?ResponseInterface {
$body = '<?xml version="1.0" encoding="utf-8"?><proxySuccess xmlns="http://www.yale.edu/tp/casClient" />';

return $this
->cas
->handleProxyCallback($parameters, $response)
->withBody(
$this
->streamFactory
->createStream($body)
);
}

/**
Expand All @@ -111,25 +122,6 @@ public function logout(array $parameters = []): ResponseInterface
return $this->cas->logout($parameters);
}

/**
* {@inheritdoc}
*/
public function handleProxyCallback(
array $parameters = [],
?ResponseInterface $response = null
): ?ResponseInterface {
$body = '<?xml version="1.0" encoding="utf-8"?><proxySuccess xmlns="http://www.yale.edu/tp/casClient" />';

return $this
->cas
->handleProxyCallback($parameters, $response)
->withBody(
$this
->streamFactory
->createStream($body)
);
}

/**
* {@inheritdoc}
*/
Expand Down
3 changes: 0 additions & 3 deletions src/Security/Core/User/EuloginUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,6 @@ public function getPassword()
{
}

/**
*
*/
public function getPgt(): ?string
{
return $this->user->getPgt();
Expand Down

0 comments on commit fdccd59

Please sign in to comment.