База знаний FAM/MFA+ : Настройка MFA/SSO для Communigate Pro

Общие сведения


Приложение А. Сценарий аутентификации в CommunigatePro


var baseURL = 'http://external-url';
var targetURL = 'https://internal-url/'

credentials = context.GetCredentials();
var signInUrl = baseURL + 'XIMSSLogin/?errorAsXML=1&EnableUseCookie=1&x2auth=1&canUpdatePwd=1&version=6.1&userName=' + credentials.Username + '&password=' + credentials.Password;

var response = context.Send(
    {
        url: signInUrl,
        method: 'GET'
    });

var CharactersBeforeToken = 7;
var CharactersAfterToken = 41;
var urlID = response.body.substring(
    response.body.indexOf("urlID") + CharactersBeforeToken, 
    response.body.indexOf("urlID") + CharactersAfterToken);

var urlLogin = baseURL +  'samoware/?sid=' + urlID + '&username=' + credentials.Username + '@domain&hideLogin=1';
context.SetRedirectUrl(urlLogin);