Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to implement the authorization code flow using OAuth for the authorization to trelloapi

Alaa TAHRAOUI March 30, 2024

I'm trying to integrate trelloapi with asp.net app, I followed the instruction mentioned in the following link Authorization and I got my access token successfully using this url (https://trello.com/1/authorize?expiration=1day&name=MyPersonalToken&scope=read&response_type=token&key=***), but the token was as a fragment in the return_url (expl: http://localhost:8080/GetToken#token=....), and in my case I would like to have the token as param (with ? and not #) in the url (http://localhost:8080/GetToken?token=....) server-side app.

After some research I found that the trelloApi uses implicit flow to authorize the user, that's why the token is as a fragment and to get it as param, I need to use the authorization code flow where the OAuth is needed. 

The problem is I didn't find documentations or examples that helps me to implement the authorization flow which means implementing OAuth. I checked Glitch project and I implemented it in c# but it doesn't work, it shows messae error "OAuth consumer did not supply its key", and when I added "oauth_consumer_key" as param, I got an other error message "Invalid Signature".

 

Please I need help in these 2 points:

1- How can I get the access token as param in the url.

2- I need more details about how to implement OAuth (except those 3 urls provided in Authorization).

 

Thank you in advance

1 answer

0 votes
Mutya A
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 2, 2024

Hi Alaa,

Happy to assist with your query here. The page you shared does not properly explain the steps to take to generate a Trello API key and token for the Trello API so I'm sharing this if it helps: 

  1. Go to Power-up Admin page: https://trello.com/power-ups/admin
  2. Create a New Power-Up by clicking the "New" button in the top right of the Power-Up admin portal.
  3. Follow the steps on Adding a New Power-Up 
  4. Once you already submitted the form to create your Power-Up, you will be taken to the API Key tab to Generate a New API key.
  5. On the same page where you found your newly generated API key, click the hyperlinked "Token" at the right of the API key.
  6. Once you click Allow you'll grant your own app (identified via your API key) access to your account and be redirected to a page that contains the API token. Here's more info on how to generate a token.

Once you have the Trello API Key and Token you can apply that in your current code. If it still does not work and is giving errors, this would be a really great question to re-share in our Trello developer community. We have a number of Trello Engineers that are active there, and they'd be happy to give some guidance for more advanced topics like these: https://community.developer.atlassian.com/c/trello

Hope this helps!
----
If this post helps your query, then please consider Accept answerLike or click up arrow to Vote to help the other users find it more quickly. 

Alaa TAHRAOUI April 3, 2024

Hi Mutya, 

Thank you for your answer.

I would like to tell you that my problem is not about how to generate the token, I already did this successfully. Maybe I didn't explain my issue well.

I would like to implement the authorization process using OAuth instead of route authorization and I could not find enough documentation about it. 

I'm looking for OAuth implementation because when I used route authorization, the generated token is returned as fragment in the URL and this case is not what I need, I need the token to be as param in the URL. 

 

Mutya A
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 3, 2024

Hi Alaa,

Appreciate the response. As mentioned, this would be a really great question to share in our Trello developer community page. We have a number of Trello Engineers that are active there, and they'd be happy to give some guidance for more advanced topics like these.

You can post your query here: https://community.developer.atlassian.com/c/trello

Like Alaa TAHRAOUI likes this
Alaa TAHRAOUI April 3, 2024

Okey then, I appreciate you answer and time.

Like Mutya A likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events