Unable to Automatically Login to Retroachievements

retrogames Aug 16, 2023

Synopsis

You break out your retro hand held, fire up a game, and see that retroarch doesn't automatically log you into retroachievements.org. No problem; you open your retroarch settings, reset your user name and password, and restart the same game. Nope. You are still unable to log in. Let's fix this problem.

The Problem

This is caused by a cached token that is saved in your retroarch configuration file. This token is generated by the retroachievements API and saved to your local retroarch.cfg file when you first authenticate yourself. Without knowing the specifics of the API, I am assuming that after a specific amount of time, or account inactivity, the token is invalidated by the API. This wouldn't be such a problem if the token would automatically refresh itself. However, this is not the case, and it is not possible to automatically get a new token from the API. Instead, the same invalid token remains in your retroarch.cfg file and prevents all future login attempts. I am not sure if this is a problem specific to ArkOS, or if it is a general problem with retoroarch. Let us know in the comments if you have more information.

The Solution

The solution is simple. All we have to do is change a few settings in the retroarch config files. There are two ways to do this. 1. Edit the files directly on your handheld 2. Use a computer to edit the files.

Edit files with 351Files

Wtih ArkOS, you can edit files directly using the 351Files application[1]. Go to Options -> 351Files. When it opens, you will be presented with a file navigation view. When you are finished editing the files, you can exit 351Files by pressing 'Y', 'X' then scroll down to 'Quit'.

Edit files with Computer

Firstly, let's remove the operating system SD card from the hand held and insert it into you computer. Mount the 4th partition to a local folder. For non-linux users, your OS will probably do this automatically. For example:

mount /dev/sdb4 /mnt/arkos

Change directories to the mounted file system:

cd /mnt/arkos

Editing Files

Next, we need to edit the retroarch.cfg files. There will be two of them in the following directories:

/home/ark/.config/retroarch/retroarch.cfg
/home/ark/.config/retroarch32/retroarch.cfg

Open the files in your text editor of choice. You will need to replace the "cheevos_token" value with an empty string in both files:

cheevos_token = ""

If your password string is empty, replace it with your current password:

cheevos_password = "INSERT-YOUR-PASSWORD-HERE"

Save the files and quit. Let's test it. Plug the SD card back into your hand held, start up a game, and see if it works.

Final Thoughts

This is a hacky fix to this problem. It could be more streamlined with a shell script containing some quick sed magic. Or how about some automatic refresh capability straight out of the box? Let us know if you also have this problem, or if you know of a more elegant fix. If enough people are interested in a shell script, which would automate the process, let me know in the comments and I'll write one. Until next time, happy gaming.


  1. A big thanks goes out to Robyn for pointing out this solution. ↩︎

Tags