<?php
$packageName = 'pkg_forecast_web';
$reportName = 'prc_sum_base';
$client = 'ALAS';
$reportUrl = "https://se/ords/webdba/TMSODBC.$packageName.$reportName?p_client=$client";
$employeeId = 'ANDRIY PI';
// Please enter any id/key from access_key table
// select * from tms.access_key;
$privateKeyID = "key_1";
$privateKey = "dfr....h";
$stringToSign = $employeeId . $dateStr . $privateKey;
$signature = hash_hmac('sha256', $stringToSign, $privateKey);
$token = base64_encode($dateStr . '|' . $privateKeyID . '|' . $signature);
//SSO - report url
printf('%s&p_user=%s&p_token=%s',
PD9waHAKJHBhY2thZ2VOYW1lID0gJ3BrZ19mb3JlY2FzdF93ZWInOwokcmVwb3J0TmFtZSA9ICdwcmNfc3VtX2Jhc2UnOwokY2xpZW50ID0gJ0FMQVMnOwokcmVwb3J0VXJsID0gImh0dHBzOi8vc2Uvb3Jkcy93ZWJkYmEvVE1TT0RCQy4kcGFja2FnZU5hbWUuJHJlcG9ydE5hbWU/cF9jbGllbnQ9JGNsaWVudCI7CgokZW1wbG95ZWVJZCA9ICdBTkRSSVkgUEknOwoKLy8gUGxlYXNlIGVudGVyIGFueSBpZC9rZXkgZnJvbSBhY2Nlc3Nfa2V5IHRhYmxlCi8vIHNlbGVjdCAqIGZyb20gdG1zLmFjY2Vzc19rZXk7CiRwcml2YXRlS2V5SUQgPSAia2V5XzEiOwokcHJpdmF0ZUtleSA9ICJkZnIuLi4uaCI7CgokZGF0ZVN0ciA9IGdtZGF0ZSgnWW1kSGlzJyk7CiRzdHJpbmdUb1NpZ24gPSAkZW1wbG95ZWVJZCAuICRkYXRlU3RyIC4gJHByaXZhdGVLZXk7CiRzaWduYXR1cmUgPSBoYXNoX2htYWMoJ3NoYTI1NicsICRzdHJpbmdUb1NpZ24sICRwcml2YXRlS2V5KTsKCiR0b2tlbiA9IGJhc2U2NF9lbmNvZGUoJGRhdGVTdHIgLiAnfCcgLiAkcHJpdmF0ZUtleUlEIC4gJ3wnIC4gJHNpZ25hdHVyZSk7CgovL1NTTyAtIHJlcG9ydCB1cmwKcHJpbnRmKCclcyZwX3VzZXI9JXMmcF90b2tlbj0lcycsIAoJJHJlcG9ydFVybCwgdXJsZW5jb2RlKCRlbXBsb3llZUlkKSwgdXJsZW5jb2RlKCR0b2tlbikpOwo=