Active Collab v5 问题令牌 API 调用返回“无效密码"即使密码有效

编程入门 行业动态 更新时间:2024-10-19 19:35:29
本文介绍了Active Collab v5 问题令牌 API 调用返回“无效密码"即使密码有效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我正在尝试通过此调用获取 API 令牌:

I am trying to obtain an API Token via this call:

curl -H "Content-Type: application/json" -X POST -d '{"username": "MY_EMAIL","password": "MY_PWD","client_name": "XXX","client_vendor": "XXX"}' https://app.activecollab/MY_ID/api/v1/issue-token

但即使密码正确,我也收到此回复:

But I am receiving this response even though the password is correct:

{
    "type":"ApiSubscriptionError",
    "message":"Invalid password",
    "code":3
}

我正在按照 https://labs.activecollab 上的说明进行操作/nightly-activecollab-api/v1/authentication.html

有人可以使用 Active Collab v5 API 吗?如果是这样,你能帮忙找出问题吗?

Is anyone able to use the Active Collab v5 API OK? If so, can you help spot the trouble?

推荐答案

认证分两步完成.第一个是向主要身份验证服务(https://activecollab)进行身份验证:

Authentication is done in two steps. First one is to authenticate to main authentication service (https://activecollab):

curl -XPOST -d 'email=user@example&password=******' https://activecollab/api/v1/external/login

此调用将返回经过身份验证的用户有权访问的帐户列表以及用户详细信息:

This call will return a list of accounts that authenticated user has access to, as well as user details:

{
    "is_ok": true,
    "accounts": [
        {
            "class": "FeatherApplicationInstance",
            "display_name": "Company Name (ID: #ACCOUNT_ID#)",
            "name": 1,
            "url": "https://app.activecollab/#ACCOUNT_ID#"
        }
    ],
    "user": {
        "avatar_url": "https://activecollab/avatars/user_#USER_ID#.png",
        "first_name": "John",
        "last_name": "Doe",
        "intent": "long string"
    }
}

在用户属性中,有 intent 属性.它用于再次验证特定的 Active Collab 5 帐户,如下所示:

Among user properties there's intent property. It is used to authenticate agains a particular Active Collab 5 accounts, like this:

curl -XPOST -d 'intent=LONG-INTENT-STRING-HERE&client_name=AppName&client_vendor=AppVendor' https://app.activecollab/#ACCOUNT_ID#/api/v1/issue-token-intent

客户供应商和客户名称是您的组织名称和应用名称.此调用将返回一个令牌,您可以使用该令牌在该帐户中进行进一步的 API 调用:

Client vendor and client name are names of your organisation, and name of your app. This call will return a token that you can use to make further API calls in that account:

curl -H "X-Angie-AuthApiToken: TOKEN-HERE" https://app.activecollab/#ACCOUNT_ID#/api/v1/projects

这篇关于Active Collab v5 问题令牌 API 调用返回“无效密码"即使密码有效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-18 16:00:50,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/942695.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:密码   令牌   Collab   Active   API

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!