
DB refactoring Client Admin Rectoring upgraded layout to use latest bootstrap Added bower support Added Behat support OIDC Discovery suuport added OIDC JWKS endpoint added Refactored OpenId workflows Refactored OAuth2 workflows Server Keys Admin Added Authorization Code Flow refactored to support OIDC Allow native apps to use auth code grant Allow native apps to use "TokenEndpoint_AuthMethod_PrivateKeyJwt" Filter on UI public/private keys algs based on the key usage Set as default auth protocol for private clients "client_secret_basic" Added feature client_secret_expired Filtered content of Token Endpoint Authorization Signed Algorithm based on Token Endpoint Authorization Method Implemented OAuth 2.0 Multiple Response Type Encoding Practices Implemented OAuth 2.0 Form Post Response Mode Implicit Flow refactored to support OIDC UserInfo Endpoint (OIDC/Claims) Hybrid Flow OIDC Session Management Change-Id: If3d38666f3f7f56bd8c94b9df2e6340554512612
59 lines
1.7 KiB
PHP
59 lines
1.7 KiB
PHP
<?php
|
|
|
|
use openid\exceptions\InvalidOpenIdMessageException;
|
|
use openid\helpers\OpenIdErrorMessages;
|
|
use openid\IOpenIdProtocol;
|
|
use openid\services\IMementoOpenIdSerializerService;
|
|
use openid\strategies\OpenIdResponseStrategyFactoryMethod;
|
|
use openid\OpenIdMessage;
|
|
use openid\responses\OpenIdResponse;
|
|
/**
|
|
* Class OpenIdProviderController
|
|
*/
|
|
class OpenIdProviderController extends BaseController
|
|
{
|
|
/**
|
|
* @var IOpenIdProtocol
|
|
*/
|
|
private $openid_protocol;
|
|
/**
|
|
* @var IMementoOpenIdSerializerService
|
|
*/
|
|
private $memento_service;
|
|
|
|
/**
|
|
* @param IOpenIdProtocol $openid_protocol
|
|
* @param IMementoOpenIdSerializerService $memento_service
|
|
*/
|
|
public function __construct(IOpenIdProtocol $openid_protocol, IMementoOpenIdSerializerService $memento_service)
|
|
{
|
|
$this->openid_protocol = $openid_protocol;
|
|
$this->memento_service = $memento_service;
|
|
}
|
|
|
|
/**
|
|
* @return OpenIdResponse
|
|
* @throws Exception
|
|
* @throws InvalidOpenIdMessageException
|
|
*/
|
|
public function endpoint()
|
|
{
|
|
$msg = new OpenIdMessage( Input::all() );
|
|
|
|
if($this->memento_service->exists()){
|
|
$msg = OpenIdMessage::buildFromMemento( $this->memento_service->load());
|
|
}
|
|
|
|
if (!$msg->isValid())
|
|
throw new InvalidOpenIdMessageException(OpenIdErrorMessages::InvalidOpenIdMessage);
|
|
|
|
//get response and manage it taking in consideration its type (direct or indirect)
|
|
$response = $this->openid_protocol->handleOpenIdMessage($msg);
|
|
|
|
if ($response instanceof OpenIdResponse) {
|
|
$strategy = OpenIdResponseStrategyFactoryMethod::buildStrategy($response);
|
|
return $strategy->handle($response);
|
|
}
|
|
return $response;
|
|
}
|
|
} |