Cannot use REST API
kuba-orlik opened this issue · 2 comments
kuba-orlik commented
Describe the bug
Cannot get the REST API auth flow to work. You can see this script for reference:
WEKAN_URL="https://my-domain.com/wekan"
USERNAME="kuba"
PASSWORD="my_password"
PROXY_AUTH="Proxy-Authorization: Basic $(printf "$USERNAME:$PASSWORD" | base64 --wrap=0)"
TOKEN=$(http POST $WEKAN_URL/users/login "$PROXY_AUTH" "username=$USERNAME" "password=$PASSWORD" | jq .token | sed 's/"//g')
echo "TOKEN:'$TOKEN'"
WEKAN_AUTH="Authorization: Bearer $TOKEN"
http -v $WEKAN_URL/api/boards/ "$PROXY_AUTH" "Accept: application/json" "$WEKAN_AUTH"
Loging in works, but the auth token provided by successful login doesn't work. It throws:
{
"error": "Unauthorized",
"errorType": "Meteor.Error",
"isClientSafe": true,
"message": "Unauthorized [Unauthorized]",
"reason": "Unauthorized",
"statusCode": 401
}
Context
- Hardware: VPS bought online
- YunoHost version: 4.4.2.14
- I have access to my server: Through SSH
- Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: no
- Using, or trying to install package version/branch: 6.53~ynh1
yalh76 commented
what is the http
command you are using ?
Your instance is public or private ?
xet7 commented
REST API works with api.py at https://github.com/wekan/wekan
This issue can be closed.