Failed to disable authentication
ritwikgiri opened this issue · 5 comments
Type of issue
- Bug
- New feature
- Improvement
Description
Failed to disable authentication following https://github.com/Azure/azure-iot-pcs-remote-monitoring-dotnet/wiki/Developer-Reference-Guide#disable-authentication. Seems the curl command _keyvault_secret_bundle=$(curl -X PUT -H "Content-Type: application/json" -H "Authorization: Bearer $AUTH_TOKEN" -d "{"value": $2}" -L https://$PCS_KEYVAULT_NAME.vault.azure.net/secrets/corsWhitelist/?api-version=7.0) in the /app/auth.sh giving an error like
{"error":{"code":"BadParameter","message":"Property value has invalid value\r\nProperty value has invalid value\r\n"}}
Screenshot
Steps to reproduce
- sudo /app/start.sh --unsafe
- POST request using postman https://xxxxxxx.azurewebsites.net/telemetry/v1/alarms
Expected behavior
Current behavior
Known workarounds
Possible solution
Need to fix /app/auth.sh.
Context and Environment
- Operating System: ...
- GitHub branch: ...
- .NET Runtime: ...
I am having the same issue here, @ritwikgiri did you solved it?
I am having the same issue here, @ritwikgiri did you solved it?
No still not resolved..
I found a problem with the script. in set_env_vars function, when is calling the _set_keyvault_secret, the second parameter must start and finish with a " becouse this parameter is used as a value in a JSON parameter
set_env_vars() {
# parse through all variables (Every odd variable is env var name & even variables are secret key names in Key vault).
if [ "$1" == "enable" ]; then
_set_keyvault_secret "true" "\"\""
else
_set_keyvault_secret "false" "\"{ 'origins': ['*'], 'methods': ['*'], 'headers': ['*'] }\""
fi
}
But this doesn't fix the problem.i think that the problem is the CORS instruction, but i don't where this is used to check it.
Submitted what I think is the same issue on the dotnet microservices repo https://github.com/Azure/remote-monitoring-services-dotnet/issues/250 but got no response. Tried playing around with the start.sh script but didn't manage to fix this.
Note: As of December 10th 2020, Remote Monitoring solution accelerator is no longer supported. All supporting repositories have been archived.