Unable to login to forge

Unable to login to Forge using API Key (Not behind any corporate proxy, using my personal laptop)

Tried by referring,
https://community.developer.atlassian.com/t/unable-to-login-forge/64314

https://developer.atlassian.com/platform/forge/getting-started/#using-environment-variables-to-login

Attached screenshot with details

is this something to be looked upon ?
I am an admin and generated this token using admin email

Additional information:

Hey Nagarajan,

Did you run forge login first?
You can follow the following instructions to get started: https://developer.atlassian.com/platform/forge/getting-started/

Let me know how you go.

Cheers
Ben

Hello Ben,

Thanks for taking your time to evaluate this.

As mentioned in the page,

  • If you are using environment variables instead of the keychain, do not use the forge login command and proceed directly to utilizing other Forge commands.
  • If you use environment variables to store your credentials, the Forge CLI will use them regardless of whether there are credentials stored in a local keychain.

So I am not using Forge Login, the same has been explained here in details

1 Like

Hey Nagarajan,

  • Is this a newly generated token? Or is it an existing token that used to work before?
  • How did you generate the token? That is, in Atlassian account page did you select “Create API token” or “Create API token with scopes”?
    • API tokens with scope are not supported by Forge CLI yet and you’d get a Forge CLI currently does not support API tokens with scopes. To use CLI, create an API token without scopes by selecting Create API token. Support for scoped API tokens will be included in a future release error in that case.
  • Can you double check if your token has an expiry date?
  • Can you try with a new token so that we can rule out a copy/paste or typo mistake?

FWIW, I’ve just tested the similar steps with a newly created token (using “Create API token”) and it just worked.

# verify not logged in

$ forge whoami
Error: Not logged in.

# set credentials as env vars and export them

$ read FORGE_EMAIL
<paste email>

$ read FORGE_API_TOKEN
<paste token>

export FORGE_EMAIL FORGE_API_TOKEN

# test with credentials

$ forge whoami
Logged in as Mehmet Atas
1 Like

Thanks for the detailed reply.

  • Is this a newly generated token? Or is it an existing token that used to work before?
    Response: Its newly generated token

  • How did you generate the token? That is, in [Atlassian account] page did you select “Create API token” or “Create API token with scopes”?

Response: I have selected “Create API token” and generated the token. No scope is involved.

  • Can you double check if your token has an expiry date?
    Response: Yes, checked and i could confirm the expiration date as 22 Jul 2026

  • Can you try with a new token so that we can rule out a copy/paste or typo mistake?
    Response: Tried generating multiple tokens using two of my emails (Two separate Atlassian accounts) but did not work.

Brief background:

  1. Tried this setup first in a corporate machine but to rule out corporate proxy issue made the setup in personal notebook, still didnot work.

  2. To rule out copy paste issues
    a. Tried avoiding ctrl+v and used mouse right click while pasting API key.
    b. Given read FORGE_API_TOKEN instead of read -s FORGE_API_TOKEN
    to visually check each character after pasting the same in Terminal

  3. To rule out access related issue / account related issue created one more Atlassian account using my alternative id and generated API key even with that, but still the same outcome.

  4. To rule out command prompt and copy paste issue (Windows machine), tried the same with VS code Terminal, command prompt, Windows Power shell, MINGW64

  5. To rule out API key’s access tried CURL with API key and confirmed that API Key was accessed using “Last accessed” field in [Atlassian account]

Curl details here: Unable to login to forge - #2 by NagarajanBalasubrama

Kindly let me know if there is any additional details required from my side.

P.S: Tried the below once again after your feedback and sharing the results for reference

Step1:

$ forge whoami

Error: Not logged in. If a local keychain is available, run forge login, otherwise set environment variables before trying again.

Rerunning the command with --verbose may give more details.

$ read FORGE_EMAIL

$ read FORGE_API_TOKEN

$ export FORGE_EMAIL FORGE_API_TOKEN

$ forge whoami

Error: UserNotFoundError

Read “Last accessed” field in security section of the API Token and value is “Never Accessed”

Step2:

Curl -v https://mysite.atlassian.net --user email : API token
Read “Last accessed” field of the API Token and value is “2 minutes ago”

Just replying for reach

Hi Nagarajan,

Thanks for detailed reply. I’ve tried to reproduce the Error: UserNotFoundError error and I got this error when I;

  • Provided a wrong email address
  • Provided a wrong token
  • Deleted the token

This is going to be a long shot but when you log into your Atlassian account what email address do you see when you click on your profile image at the top right? Can you make sure it is the same email address used for FORGE_EMAIL?

Can you also try

  • forge login without setting environment variables and input your email and token when asked.
  • forge login -u <email> -t <token> again without setting environment variables.

Hello @MehmetAtas,

Thanks a lot for your feedback.

Sorry for the delay in response.

  1. FORGE_EMAIL - it’s the same email and its corresponding API key that I am using still having this issue.

  2. forge login without setting environment variables and input your email and token when asked.
    forge login -e <email> -t <token> again without setting environment variables

Tried these steps already and tried again now, still having challenge in logging.

Hi Nagarajan,

Thanks for the reply and I understand the frustration you might have. I’m afraid we won’t be able to solve your case on our Developer Community and I recommend you to get in touch with our support team who can have a closer look at your case.

You can submit a ticket at Developer and Marketplace support. You can find more information on our Developer and Marketplace support process on Get help and give feedback page.

Thanks,
Mehmet.

Thanks for your feedback.
Have raised support ticket and will wait for further feedback. Jira Service Management

Post resolution will update the solution as well to this post.

Thanks a lot for everyone who their time in supporting on this topic.

Hello Team,

Please be informed that issue has been resolved.

As suggested by the support team tried generating the token in private / incognito mode and it worked.

Thanks a lot for all your time and support for closing this :slight_smile:

Regards,
Naga