I created an app in develop console and set a callback url http://localhost:3000/oauth/callback in Authorization. When I tried to get the authorization code in terminal:
However, when run curl -X GET "$AUTH_URL" in terminal, I got this error:
<!doctype html><html lang="en"><head><title>HTTP Status 400 – Bad Request</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>HTTP Status 400 – Bad Request</h1></body></html>
Where is wrong? Is it possible to add http://localhost:3000/oauth/callback to develop console’s Callback URL?
I wonder if your problem isn’t the the callback URL at all but is how you are calling the authorize endpoint “in terminal”. Are you trying to curl it? I hope it’s clear that OAuth 2.0’s authorization code flow requires the browser.
There’s nothing wrong with a localhost callback URL. In this previous thread, I shared a CLI tool that does that:
Thank you @ibuchanan .
Yes, I tried to curl it curl -X GET "$AUTH_URL" and got a 400 static page.
If localhost works well for a callback, I think it’s right to run it from terminal via curl.
I tried your script. After setting ATLASSIAN_APP_3LO_CLIENT_ID and ATLASSIAN_APP_3LO_CLIENT_SECRET and run it by sh atlassian-oauth2.sh, got this error: