Authentication user credentials using trello API

719 views Asked by At

We are having a Trello board having 8 members in it. I am developing an application where I should allow only these 8 members to log in to my application. Is there a way to do this using Trello's API? (I am thinking of authenticating user credentials and making all board details available to users. If any of the board details matches with my Trello board I will allow the user to log-in.) How do I authenticate the users and get all the board details?

1

There are 1 answers

2
gregsdennis On BEST ANSWER

You've tagged Trello.Net and Manatee.Trello. Does this mean you're trying to use one of these SDKs and .Net? If so, the answer will depended on which on. While I can't speak for Trello.Net, I can answer for Manatee.Trello (I created it).

I would suggest you check their membership to your board. Since your board is well-known you can save the ID locally. When the user enters their credentials, you get their boards and check for yours.

var myBoardId = "[your board's ID]";
if (Member.Me.Boards.Any(b => b.Id == myBoardId))  // Member.Me is your user
{
    // member is on the board.
}

It's simpler if your board is private (can only be seen by its members). Just instantiate the board and try to access any property:

try
{
    var board = new Board("[your board's ID]");
    Console.WriteLine(board); // prints the board's name.  This is when the data is downloaded.
}
catch (Exception e)
{
    // member does not have access to your board.
}

There are likely other ways to verify board membership using Manatee.Trello, but these are what I'd do.