简体   繁体   English

使用用户名和密码访问HipChat API

[英]Accessing the HipChat API With Username and Password

I'm attempting to write a simple script that I can run from my command line that will send warning messages to certain users on HipChat, and I've run into some issues around authentication. 我试图编写一个可以从命令行运行的简单脚本,该脚本会将警告消息发送给HipChat上的某些用户,并且我遇到了一些有关身份验证的问题。 Ideally, I'd like to have the script prompt the user for their HipChat username and password, and use them to log into the Hipchat API. 理想情况下,我想让脚本提示用户输入其HipChat用户名和密码,并使用它们登录Hipchat API。 However, it seems that Hipchat doesn't offer this functionality, and I'm not sure what to do. 但是,Hipchat似乎不提供此功能,因此我不确定该怎么做。

The documentation seems to suggest I manually generate a token, and use that instead. 该文档似乎建议我手动生成令牌,并改为使用令牌。 While this is definitely an option, it seems a little less user friendly, so I wanted to double check that there wasn't an alternative before going ahead. 尽管这绝对是一个选择,但它似乎对用户不友好,因此我想在继续之前再次检查是否有其他选择。 I want to avoid the installation and OAuth flows as much as possible (I don't think they're an option). 我想尽可能避免安装和OAuth流(我不认为这是一个选择)。

Any thoughts? 有什么想法吗? I'm open to alternative suggestions, although it really seems like Basic Auth or simple token generation would be an option. 我愿意接受其他建议,尽管实际上看起来像Basic Auth或简单令牌生成将是一种选择。

The hipchat APIs don't support username+password as authentication, for security reasons (you don't want your password flowing through every API call). 出于安全考虑,hipchat API不支持用户名和密码作为身份验证(您不希望密码在每个API调用中都流过)。

The OAuth flow you mention is used for the integrations. 您提到的OAuth流程用于集成。 If you want to try the API manually (or to script them), there's a simpler auth flow: 如果您想手动尝试API(或为它们编写脚本),则有一个更简单的身份验证流程:

Full information is available here: https://developer.atlassian.com/hipchat/guide/hipchat-rest-api 完整的信息可以在这里找到: https : //developer.atlassian.com/hipchat/guide/hipchat-rest-api

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM