Skip to content

Commit

Permalink
adapt hosteurope_domservice.sh to new SSO method of hosteurope
Browse files Browse the repository at this point in the history
  • Loading branch information
Aikhjarto committed Dec 25, 2018
1 parent a8ad9da commit d0fdf7b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# HINT: As of 2018, hoseurope change the authentication method for kis.hosteurope.de so this scripts do not work since then.

# hosteurope_domservice
Tools for managing the domains with http://kis.hosteurope.de

Expand Down
29 changes: 24 additions & 5 deletions hosteurope_domservice.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,31 @@ get_start_line() {


# uncomment first line if you have curl and second line if you have wget
#FETCH_BIN="curl -s --url"
FETCH_BIN="wget -qO-"
FETCH_BIN="curl -s -b hosteurope.cookies --url "
#FETCH_BIN="wget -qO-"

# start URL
URL_START="https://kis.hosteurope.de/administration/domainservices/index.php?kdnummer=$HE_USERNAME&passwd=$HE_PASSWORD&menu=2&submode=edit&mode=autodns&domain=$DOMAIN"
# login
RES=$($FETCH_BIN 'https://sso.hosteurope.de/api/app/v1/login' -H 'Origin: https://sso.hosteurope.de' -H 'Content-Type: application/json' -H 'Accept: application/json, text/plain, */*' -H 'Referer: https://sso.hosteurope.de/' -H 'Connection: keep-alive' -H 'DNT: 1' --data-binary "{\"brandId\":\"b9c8f0f0-60dd-4cab-9da8-512b352d9c1a\",\"locale\":\"de-DE\",\"identifier\":\"$HE_USERNAME\",\"password\":\"$HE_PASSWORD\"}" --compressed -c hosteurope.cookies)
if [ $? -ne 0 ]; then
logger $LOGGER_OPTS "ERROR: cannot login; ${FETCH_BIN} failed with $?"
exit 1
fi
if [ -z ${RES} ]; then
logger $LOGGER_OPTS "ERROR: Login did not produce a result."
exit 1
fi

if [ ${RES} == '{"success":true}' ]; then
if [ ! -z $DEBUG ]; then
logger $LOGGER_OPTS "DEBUG: Login successfull"
fi
else
logger $LOGGER_OPTS "ERROR: Login resulted in ${RES}"
exit 1
fi

# URL prefix
URL_START="https://kis.hosteurope.de/administration/domainservices/index.php?menu=2&submode=edit&mode=autodns&domain=$DOMAIN"

# get list of all DNS entries (more information is stored on the webpage than it's visible).
# Purge unneeded stuff to save space (important on embedded devices)
Expand Down Expand Up @@ -244,4 +264,3 @@ if [ -z ${DEBUG} ]; then
[[ -e ${TMP_FILE} ]] && rm ${TMP_FILE}
[[ -e ${RES_FILE} ]] && rm ${RES_FILE}
fi

0 comments on commit d0fdf7b

Please sign in to comment.