Unable to login - forge

I’m hacking for devsunleashed. I’m unable to log in using my API token key. I’m using the correct email and copy-pasting the correct token API as well, but still unable to log in; please help me.

Welcome to the community @yashgadhade !
I know you probably tried that already, but can you try to generate a new token from the link provided on this screenshot? Alternatively, if that continues to give you the same error, could you try to login using environment variables? This could be that forge login is not managing to store your credentials correctly on your system.

I’m still unable to get it.

Is this because I have used Google sign in? Using environment variables I’m not able to do it, please help

I have also tried the other way by adding FORGE_EMAIL & FORGE_API_TOKEN to the environment and calling - forge login --email $FORGE_EMAIL --token $FORGE_API_TOKEN. It still isn’t working; it’s giving me the same reason.

I want to use this for a hackathon; please help me.

Now that I see that you’re using PowerShell, the issue you’re facing here @yashgadhade is that the login steps assume you’re based on a unix-like system, not Windows. Environment variables work in different ways in these systems.

Here’s a couple of ideas that you could try:

  • Using PowerShell’s way of adding Environment variables;
  • Using an terminal emulator like Cygwin, git-for-windows, or Mingw with ConEmu;
  • Running the command you mentioned in your last comment but without using the variables, just typing the values directly.

If none of the above works, we may look further into solving this issue.

Thanks for the response @vdebone
I have tried all three ways.

  1. PowerShell’s way of adding Environment variables;

  2. Using a terminal emulator like git-for-windows
    image

  3. Using ubuntu WSL

Still giving me the same issue; please help me. I really want to hack into this hackathon.

Hey @yashgadhade

If you are using the environment variables you no longer need to use forge login, perhaps try calling a command like forge create with FORGE_EMAIL and FORGE_API_TOKEN set and see if that works. If not please include the output of forge create --verbose.

Also you should ensure you have invalidated the above api token in the screenshot if it is still active as it would allow others to access Atlassian APIs with your credentials.

Let me know how you go,
Sam

Thanks for the response @SamSmyth
I have revoked access to the API key while posting them here.

I tried the way you suggested, and it worked for me.

The solution is: To use a UNIX-like environment for me, MINGW64, store email and API as the environment variables in them - env:FORGE_EMAIL=“your email” & env:FORGE_API_TOKEN=“your API key” and then directly use forge create.

Thank you for the help @SamSmyth & @vdebone

1 Like