From 4b0b0ff75f04e49ecb96c6fd078a9ce775bba1b2 Mon Sep 17 00:00:00 2001 From: Aleksey Tasenko Date: Fri, 12 Aug 2022 16:59:42 +0300 Subject: [PATCH] #2547 wrong token cut from nic API response --- dnsapi/dns_nic.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dnsapi/dns_nic.sh b/dnsapi/dns_nic.sh index 56170f87..952ec57c 100644 --- a/dnsapi/dns_nic.sh +++ b/dnsapi/dns_nic.sh @@ -135,7 +135,7 @@ _nic_get_authtoken() { res=$(_post "grant_type=password&username=${NIC_Username}&password=${NIC_Password}&scope=%28GET%7CPUT%7CPOST%7CDELETE%29%3A%2Fdns-master%2F.%2B" "$NIC_Api/oauth/token" "" "POST") if _contains "$res" "access_token"; then - _auth_token=$(printf "%s" "$res" | cut -d , -f2 | tr -d "\"" | sed "s/access_token://") + _auth_token=$(printf "%s" "$res" | cut -d , -f1 | tr -d "{" | tr -d "\"" | sed "s/access_token://") _info "Token received" _debug _auth_token "$_auth_token" return 0