Skip to content
This repository has been archived by the owner on May 17, 2021. It is now read-only.

Latest commit

 

History

History
317 lines (228 loc) · 11.8 KB

SAML2SPApi.md

File metadata and controls

317 lines (228 loc) · 11.8 KB

OpenEuropa\SyncopePhpClient\SAML2SPApi

All URIs are relative to http://syncope-vm.apache.org:9080/syncope/rest

Method HTTP request Description
createLoginRequest1 POST /saml2sp/serviceProvider/loginRequest Generates SAML 2.0 authentication request for the IdP matching the provided entity ID.
createLogoutRequest1 POST /saml2sp/serviceProvider/logoutRequest Generates SAML 2.0 logout request for the IdP matching the requesting access token.
getMetadata GET /saml2sp/serviceProvider Returns the XML metadata for the provided SAML 2.0 Service Provider.
validateLoginResponse POST /saml2sp/serviceProvider/loginResponse Validates the received SAML 2.0 authentication response and creates JWT for the matching user, if found.
validateLogoutResponse POST /saml2sp/serviceProvider/logoutResponse Validates the received SAML 2.0 logout response.

createLoginRequest1

createLoginRequest1($xSyncopeDomain, $spEntityID, $idpEntityID)

Generates SAML 2.0 authentication request for the IdP matching the provided entity ID.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuthentication
$config = OpenEuropa\SyncopePhpClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

// Configure HTTP basic authorization: Bearer
$config = OpenEuropa\SyncopePhpClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new OpenEuropa\SyncopePhpClient\Api\SAML2SPApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$xSyncopeDomain = 'Master'; // string | 
$spEntityID = 'spEntityID_example'; // string | SAML 2.0 SP entity ID.
$idpEntityID = 'idpEntityID_example'; // string | SAML 2.0 IdP entity ID.

try {
    $apiInstance->createLoginRequest1($xSyncopeDomain, $spEntityID, $idpEntityID);
} catch (Exception $e) {
    echo 'Exception when calling SAML2SPApi->createLoginRequest1: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
xSyncopeDomain string [default to 'Master']
spEntityID string SAML 2.0 SP entity ID. [optional]
idpEntityID string SAML 2.0 IdP entity ID. [optional]

Return type

void (empty response body)

Authorization

BasicAuthentication, Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createLogoutRequest1

createLogoutRequest1($xSyncopeDomain, $spEntityID)

Generates SAML 2.0 logout request for the IdP matching the requesting access token.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuthentication
$config = OpenEuropa\SyncopePhpClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

// Configure HTTP basic authorization: Bearer
$config = OpenEuropa\SyncopePhpClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new OpenEuropa\SyncopePhpClient\Api\SAML2SPApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$xSyncopeDomain = 'Master'; // string | 
$spEntityID = 'spEntityID_example'; // string | SAML 2.0 SP entity ID.

try {
    $apiInstance->createLogoutRequest1($xSyncopeDomain, $spEntityID);
} catch (Exception $e) {
    echo 'Exception when calling SAML2SPApi->createLogoutRequest1: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
xSyncopeDomain string [default to 'Master']
spEntityID string SAML 2.0 SP entity ID. [optional]

Return type

void (empty response body)

Authorization

BasicAuthentication, Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, application/yaml, application/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getMetadata

getMetadata($xSyncopeDomain, $spEntityID, $urlContext)

Returns the XML metadata for the provided SAML 2.0 Service Provider.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuthentication
$config = OpenEuropa\SyncopePhpClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

// Configure HTTP basic authorization: Bearer
$config = OpenEuropa\SyncopePhpClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new OpenEuropa\SyncopePhpClient\Api\SAML2SPApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$xSyncopeDomain = 'Master'; // string | 
$spEntityID = 'spEntityID_example'; // string | SAML 2.0 SP entity ID.
$urlContext = 'urlContext_example'; // string | SAML 2.0 SP agent URL context

try {
    $apiInstance->getMetadata($xSyncopeDomain, $spEntityID, $urlContext);
} catch (Exception $e) {
    echo 'Exception when calling SAML2SPApi->getMetadata: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
xSyncopeDomain string [default to 'Master']
spEntityID string SAML 2.0 SP entity ID. [optional]
urlContext string SAML 2.0 SP agent URL context [optional]

Return type

void (empty response body)

Authorization

BasicAuthentication, Bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

validateLoginResponse

validateLoginResponse($xSyncopeDomain, $sAML2ReceivedResponseTO)

Validates the received SAML 2.0 authentication response and creates JWT for the matching user, if found.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuthentication
$config = OpenEuropa\SyncopePhpClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

// Configure HTTP basic authorization: Bearer
$config = OpenEuropa\SyncopePhpClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new OpenEuropa\SyncopePhpClient\Api\SAML2SPApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$xSyncopeDomain = 'Master'; // string | SAML response and relay state
$sAML2ReceivedResponseTO = new \OpenEuropa\SyncopePhpClient\Model\SAML2ReceivedResponseTO(); // \OpenEuropa\SyncopePhpClient\Model\SAML2ReceivedResponseTO | 

try {
    $apiInstance->validateLoginResponse($xSyncopeDomain, $sAML2ReceivedResponseTO);
} catch (Exception $e) {
    echo 'Exception when calling SAML2SPApi->validateLoginResponse: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
xSyncopeDomain string SAML response and relay state [default to 'Master']
sAML2ReceivedResponseTO \OpenEuropa\SyncopePhpClient\Model\SAML2ReceivedResponseTO [optional]

Return type

void (empty response body)

Authorization

BasicAuthentication, Bearer

HTTP request headers

  • Content-Type: application/json, application/yaml, application/xml
  • Accept: application/json, application/yaml, application/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]

validateLogoutResponse

validateLogoutResponse($xSyncopeDomain, $sAML2ReceivedResponseTO)

Validates the received SAML 2.0 logout response.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');

// Configure HTTP basic authorization: BasicAuthentication
$config = OpenEuropa\SyncopePhpClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

// Configure HTTP basic authorization: Bearer
$config = OpenEuropa\SyncopePhpClient\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');


$apiInstance = new OpenEuropa\SyncopePhpClient\Api\SAML2SPApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$xSyncopeDomain = 'Master'; // string | SAML response and relay state
$sAML2ReceivedResponseTO = new \OpenEuropa\SyncopePhpClient\Model\SAML2ReceivedResponseTO(); // \OpenEuropa\SyncopePhpClient\Model\SAML2ReceivedResponseTO | 

try {
    $apiInstance->validateLogoutResponse($xSyncopeDomain, $sAML2ReceivedResponseTO);
} catch (Exception $e) {
    echo 'Exception when calling SAML2SPApi->validateLogoutResponse: ', $e->getMessage(), PHP_EOL;
}
?>

Parameters

Name Type Description Notes
xSyncopeDomain string SAML response and relay state [default to 'Master']
sAML2ReceivedResponseTO \OpenEuropa\SyncopePhpClient\Model\SAML2ReceivedResponseTO [optional]

Return type

void (empty response body)

Authorization

BasicAuthentication, Bearer

HTTP request headers

  • Content-Type: application/json, application/yaml, application/xml
  • Accept: application/json, application/yaml, application/xml

[Back to top] [Back to API list] [Back to Model list] [Back to README]