Skip to content

Commit

Permalink
changed jamfapi_invalidatetoken
Browse files Browse the repository at this point in the history
  • Loading branch information
scriptingosx committed Feb 23, 2022
1 parent 60417cb commit 9ff1f00
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions Jamf/Upload_CISBenchmarkReport.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export PATH=/usr/bin:/bin:/usr/sbin:/sbin
# Insert base64-encoded credentials within Parameter 4 in Jamf Pro
#
# Created base64-encoded credentials:
# printf "username:password" | /usr/bin/iconv -t ISO-8859-1 | /usr/bin/base64 -i -
# printf "username:password" | iconv -t ISO-8859-1 | base64 -i -
#
####################################################################################################
####################################################################################################
Expand Down Expand Up @@ -76,17 +76,6 @@ function jamfapi_gettoken {
api_expiration=$(json_get $json "expires")
}

function jamfapi_invalidatetoken {
if ! curl $curloptions \
--request POST \
--header "Authorization: Bearer $api_token" \
$url/api/v1/auth/invalidate-token
then
echo "could not invalidate api token"
exit 4
fi

}

# function that encapsulates Jamf API calls
function jamfapi_request {
Expand Down Expand Up @@ -130,6 +119,15 @@ function jamfapi_put {
jamfapi_request PUT $@
}

function jamfapi_invalidatetoken {
if ! jamfapi_post "v1/auth/invalidate-token"
then
echo "could not invalidate api token"
exit 4
fi

}

function json_list_attachments {
# $1: json text
# $2: path in json, e.g. `computers`
Expand Down

0 comments on commit 9ff1f00

Please sign in to comment.