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.
Hard-coding credentials is the software development practice of embedding authentication data -- user IDs and passwords -- directly into the source code of a program or other executable object. This is as opposed to obtaining the credentials from external sources or generating them at runtime.
Developers must avoid hardcoding sensitive data, users must be forced to use strong passwords and it is recommended to store sensitive data such as passwords using strong adaptive and salted hashing functions with a work factor (delay factor), such as Argon2, scrypt, bcrypt or PBKDF2.
Hardcoding is when you directly give a value instead of using a variable. Variables can be re-used at different locations in your code.
Including unencrypted hard-coded inbound or outbound authentication credentials within source code or configuration files is dangerous because the credentials may be easily discovered.
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).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With