Hardcode login credentials in c# for trello api

1.9k views Asked by At

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.

1

There are 1 answers

0
dillenmeister On

Instead of hardcoding the credentials, you could hardcode the token.

Visit this url (replace some parameters first):

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

Hardcode the token you get back and do:

trello.Authorize(hardcodedToken);

(Or you can have Trello.NET generate that url using trello.GetAuthorizationUrl() but since you're only doing this once, I see no point).

How to authorize a client (from Trello documentation).