Использование: REST API и клиентские библиотеки SDK. REST API — только через POST-запросы.
Кто использует:
Enterprise Admin
Domain Admin
Pro
Analyst
Viewer
Basic
Сигнатура метода
Входные параметры
Имя
userSamlCredentials
Тип объекта
UserSamlCredentials
Описание
Учётные данные пользователя для аутентификации по SAML-токену.
Выходной ответ
Код успешного результата
200
Тип ответа
string
Описание типа ответа
Ответ представляет собой токен безопасности в виде строки base64. Обычно он сохраняется в cookie.
Примечания
Токен безопасности — это строка, которую нужно добавить в cookie на странице стороннего узла, где размещён встраиваемый контент, чтобы доступ был авторизован. Предполагается, что пользователь уже прошёл аутентификацию через SAML в приложении, где размещён контент, до попытки аутентификации в Дельта BI.
Примеры
Аутентификация пользователя для встраивания с SAML (JavaScript):
В этом примере показано, как выполнить аутентификацию пользователя для встраивания с использованием SAML-токенов из JavaScript.
// URL of the Pyramid installation and the path to the API 3.0 REST methods
var pyramidURL = "http://mysite.com/api3/";
importcom.pyramidanalytics.*;importcom.pyramidanalytics.auth.*;importcom.pyramidanalytics.model.*;importcom.pyramidanalytics.api.AuthenticationServiceApi;importjava.util.*;importjava.time.*;publicclassAuthenticationServiceApiExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=Configuration.getDefaultApiClient();defaultClient.setBasePath("http://Your.Server.URL/");// Create an instance of the API classAuthenticationServiceApiapiInstance=newAuthenticationServiceApi();// Initialize the userSamlCredentials parameter object for the callUserSamlCredentialsuserSamlCredentials=;// Create the input object for the operation, type: UserSamlCredentials try{Stringresult=apiInstance.authenticateUserEmbedSAML(userSamlCredentials);System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling AuthenticationServiceApi#authenticateUserEmbedSAML");e.printStackTrace();}}}
import*asPyramidAnalyticsWebApifrom"com.pyramidanalytics";// Create an instance of the API class
constapi=newPyramidAnalyticsWebApi.AuthenticationServiceApi("http://Your.Server.URL")constuserSamlCredentials=;// {UserSamlCredentials}
api.authenticateUserEmbedSAML(userSamlCredentials).then(function(data){console.log('API called successfully. Returned data: '+data);},function(error){console.error(error);});
using System;
using System.Diagnostics;
using PyramidAnalytics.Sdk.Api;
using PyramidAnalytics.Sdk.Client;
using PyramidAnalytics.Sdk.Model;
public class authenticateUserEmbedSAMLExample
{
public static void Main()
{
Configuration conf = new Configuration();
conf.BasePath = "http://Your.Server.URL/";
GlobalConfiguration.Instance = conf;
// Create an instance of the API class
var apiInstance = new AuthenticationServiceApi();
// Initialize the userSamlCredentials parameter object for the call
var userSamlCredentials = new UserSamlCredentials(); // UserSamlCredentials |
try {
// Generates a Pyramid access authentication token for embedding using SAML authentication tokens
string result = apiInstance.authenticateUserEmbedSAML(userSamlCredentials);
Debug.WriteLine(result);
} catch (Exception e) {
Debug.Print("Exception when calling AuthenticationServiceApi.authenticateUserEmbedSAML: " + e.Message );
}
}
}
importcom.pyramidanalyticsfromcom.pyramidanalyticsimportApiExceptionfromcom.pyramidanalyticsimportAuthenticationServiceApifrompprintimportpprintapi_config=com.pyramidanalytics.Configuration(host='http://Your.Server.URL')withcom.pyramidanalytics.ApiClient(api_config)asapi_client:# Create an instance of the API classapi_instance=AuthenticationServiceApi(api_client)# Initialize the userSamlCredentials parameter object for the calluserSamlCredentials=# UserSamlCredentials | try:# Generates a Pyramid access authentication token for embedding using SAML authentication tokensapi_response=api_instance.authenticate_user_embed_saml(userSamlCredentials)pprint(api_response)exceptApiExceptionase:print("Exception when calling AuthenticationServiceApi->authenticateUserEmbedSAML: %s\n"%e)
<?phprequire_once(__DIR__.'/vendor/autoload.php');OpenAPITools\Client\Configuration::getDefaultConfiguration()->setHost('http://Your.Server.URL');// Create an instance of the API class
$api_instance=newOpenAPITools\Client\Api\AuthenticationServiceApi();$userSamlCredentials=;// UserSamlCredentials |
try{$result=$api_instance->authenticateUserEmbedSAML($userSamlCredentials);print_r($result);}catch(Exception$e){echo'Exception when calling AuthenticationServiceApi->authenticateUserEmbedSAML: ',$e->getMessage(),PHP_EOL;}?>