5

I've been using trello.net api for trello to read through the boards etc.

I've been using the trello.GetAuthorizationUrl(); to redirect the user to a login page for trello although I'm looking for an option where I can just hard code my login credentials into the C# code.

Let me know if anyone has done that or knows how to.

4

1 回答 1

5

您可以对令牌进行硬编码,而不是对凭据进行硬编码。

访问这个网址(先替换一些参数):

https://trello.com/1/authorize?key=substitutewithyourapplicationkey&name=My+Application&expiration=never&response_type=token&scope=read,write

硬编码您返回的令牌并执行以下操作:

trello.Authorize(hardcodedToken);

(或者您可以让 Trello.NET 使用生成该 url,trello.GetAuthorizationUrl()但由于您只执行一次,我认为没有意义)。

如何授权客户端(来自 Trello 文档)。

于 2013-01-11T14:42:06.757 回答