Skip to content

Latest commit

 

History

History
504 lines (341 loc) · 15 KB

AuthenticationApi.md

File metadata and controls

504 lines (341 loc) · 15 KB

ClientAPI\Semaphore\AuthenticationApi

All URIs are relative to http://localhost:3000/api, except if the operation defines another base path.

Method HTTP request Description
authLoginGet() GET /auth/login Fetches login metadata
authLoginPost() POST /auth/login Performs Login
authLogoutPost() POST /auth/logout Destroys current session
authOidcProviderIdLoginGet() GET /auth/oidc/{provider_id}/login Begin OIDC authentication flow and redirect to OIDC provider
authOidcProviderIdRedirectGet() GET /auth/oidc/{provider_id}/redirect Finish OIDC authentication flow, upon succes you will be logged in
userTokensApiTokenIdDelete() DELETE /user/tokens/{api_token_id} Expires API token
userTokensGet() GET /user/tokens Fetch API tokens for user
userTokensPost() POST /user/tokens Create an API token

authLoginGet()

authLoginGet(): \ClientAPI\Semaphore\Model\LoginMetadata

Fetches login metadata

Fetches metadata for login, such as available OIDC providers

Example

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



$apiInstance = new ClientAPI\Semaphore\Api\AuthenticationApi(
    // 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()
);

try {
    $result = $apiInstance->authLoginGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->authLoginGet: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\ClientAPI\Semaphore\Model\LoginMetadata

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/plain; charset=utf-8

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

authLoginPost()

authLoginPost($loginBody)

Performs Login

Upon success you will be logged in

Example

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



$apiInstance = new ClientAPI\Semaphore\Api\AuthenticationApi(
    // 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()
);
$loginBody = new \ClientAPI\Semaphore\Model\Login(); // \ClientAPI\Semaphore\Model\Login

try {
    $apiInstance->authLoginPost($loginBody);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->authLoginPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
loginBody \ClientAPI\Semaphore\Model\Login

Return type

void (empty response body)

Authorization

No authorization required

HTTP request headers

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

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

authLogoutPost()

authLogoutPost()

Destroys current session

Example

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


// Configure API key authorization: cookie
$config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKey('Cookie', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Cookie', 'Bearer');

// Configure API key authorization: bearer
$config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new ClientAPI\Semaphore\Api\AuthenticationApi(
    // 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
);

try {
    $apiInstance->authLogoutPost();
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->authLogoutPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

void (empty response body)

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

authOidcProviderIdLoginGet()

authOidcProviderIdLoginGet($providerId)

Begin OIDC authentication flow and redirect to OIDC provider

The user agent is redirected to this endpoint when chosing to sign in via OIDC

Example

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


// Configure API key authorization: cookie
$config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKey('Cookie', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Cookie', 'Bearer');

// Configure API key authorization: bearer
$config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new ClientAPI\Semaphore\Api\AuthenticationApi(
    // 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
);
$providerId = mysso; // string

try {
    $apiInstance->authOidcProviderIdLoginGet($providerId);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->authOidcProviderIdLoginGet: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
providerId string

Return type

void (empty response body)

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

authOidcProviderIdRedirectGet()

authOidcProviderIdRedirectGet($providerId)

Finish OIDC authentication flow, upon succes you will be logged in

The user agent is redirected here by the OIDC provider to complete authentication

Example

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


// Configure API key authorization: cookie
$config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKey('Cookie', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Cookie', 'Bearer');

// Configure API key authorization: bearer
$config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new ClientAPI\Semaphore\Api\AuthenticationApi(
    // 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
);
$providerId = mysso; // string

try {
    $apiInstance->authOidcProviderIdRedirectGet($providerId);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->authOidcProviderIdRedirectGet: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
providerId string

Return type

void (empty response body)

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

userTokensApiTokenIdDelete()

userTokensApiTokenIdDelete($apiTokenId)

Expires API token

Example

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


// Configure API key authorization: cookie
$config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKey('Cookie', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Cookie', 'Bearer');

// Configure API key authorization: bearer
$config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new ClientAPI\Semaphore\Api\AuthenticationApi(
    // 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
);
$apiTokenId = kwofd61g93-yuqvex8efmhjkgnbxlo8mp1tin6spyhu=; // string

try {
    $apiInstance->userTokensApiTokenIdDelete($apiTokenId);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->userTokensApiTokenIdDelete: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
apiTokenId string

Return type

void (empty response body)

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

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

userTokensGet()

userTokensGet(): \ClientAPI\Semaphore\Model\APIToken[]

Fetch API tokens for user

Example

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


// Configure API key authorization: cookie
$config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKey('Cookie', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Cookie', 'Bearer');

// Configure API key authorization: bearer
$config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new ClientAPI\Semaphore\Api\AuthenticationApi(
    // 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
);

try {
    $result = $apiInstance->userTokensGet();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->userTokensGet: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\ClientAPI\Semaphore\Model\APIToken[]

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/plain; charset=utf-8

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

userTokensPost()

userTokensPost(): \ClientAPI\Semaphore\Model\APIToken

Create an API token

Example

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


// Configure API key authorization: cookie
$config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKey('Cookie', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Cookie', 'Bearer');

// Configure API key authorization: bearer
$config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = ClientAPI\Semaphore\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');


$apiInstance = new ClientAPI\Semaphore\Api\AuthenticationApi(
    // 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
);

try {
    $result = $apiInstance->userTokensPost();
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling AuthenticationApi->userTokensPost: ', $e->getMessage(), PHP_EOL;
}

Parameters

This endpoint does not need any parameter.

Return type

\ClientAPI\Semaphore\Model\APIToken

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/plain; charset=utf-8

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