mirror of
https://github.com/Telecominfraproject/wlan-cloud-userportal.git
synced 2025-11-02 11:37:51 +00:00
Adding support for IPv6.
This commit is contained in:
@@ -77,7 +77,8 @@ findbrowser() {
|
||||
me() {
|
||||
curl ${FLAGS} -X GET -H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer ${token}" \
|
||||
"https://${target_service_endpoint}/api/v1/oauth2?me=true"
|
||||
"https://${target_service_endpoint}/api/v1/oauth2?me=true" > ${result_file}
|
||||
jq < ${result_file}
|
||||
}
|
||||
|
||||
logout() {
|
||||
@@ -87,10 +88,30 @@ logout() {
|
||||
rm -rf token.json
|
||||
}
|
||||
|
||||
startmfa() {
|
||||
payload="{ \"type\" : \"sms\" , \"sms\" : \"$1\" }"
|
||||
curl ${FLAGS} -X PUT "https://${target_service_endpoint}/api/v1/submfa?startValidation=true" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer ${token}" \
|
||||
-d ${payload} > ${result_file}
|
||||
jq < ${result_file}
|
||||
}
|
||||
|
||||
completemfa() {
|
||||
payload="{ \"type\" : \"sms\" , \"sms\" : \"$1\" }"
|
||||
curl ${FLAGS} -X PUT "https://${target_service_endpoint}/api/v1/submfa?completeValidation=true&challengeCode=$2" \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Authorization: Bearer ${token}" \
|
||||
-d ${payload} > ${result_file}
|
||||
jq < ${result_file}
|
||||
}
|
||||
|
||||
shopt -s nocasematch
|
||||
case "$1" in
|
||||
"login") login; echo "You successfully logged in." ; logout ;;
|
||||
"me") login; me ; logout ;;
|
||||
"startmfa") login; startmfa "$2" ; logout;;
|
||||
"completemfa") login; completemfa "$2" "$3" ; logout;;
|
||||
*) help ;;
|
||||
esac
|
||||
|
||||
|
||||
1
test_scripts/curl/result.json
Normal file
1
test_scripts/curl/result.json
Normal file
@@ -0,0 +1 @@
|
||||
{"ErrorCode":400,"ErrorDescription":"Unsupported HTTP Method","ErrorDetails":"PUT"}
|
||||
Reference in New Issue
Block a user