Not the correct tag-IOException

Pedro Iegler8 days ago

Hi,

I'm trying to authenticate with the /api/session endpoint of Traccar using a frontend HTTP request, but I'm getting a 500 Internal Server Error. The server returns the following message:

Not the correct tag-IOException(...<CryptoManager: 75<TokenManager: 77<LoginService: 81<*: 67<SecurityRequestFilter: 76<...)

Has anyone encountered this error before or know what might be causing it when calling /api/session from the frontend?

Thanks in advance!

Anton Tananaev8 days ago

Seems like an incorrect token.

Pedro Iegler8 days ago

Here is the TypeScript code I’m using:

private loginAndConnect(): void {
  const email = 'admin';
  const password = 'admin';

  const body = new URLSearchParams();
  body.set('email', email);
  body.set('password', password);

  const headers = new HttpHeaders({
    'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
    'Accept': '*/*',
    'Accept-Language': 'pt-BR,pt;q=0.9,en-US;q=0.8,en;q=0.7',
  });

  this._httpClient.post(
    'http://localhost:8080/api/session',
    body.toString(),
    {
      headers,
      withCredentials: true,
      responseType: 'text'
    }
  ).subscribe({
    next: (response) => {
      console.log(response);
      this.connect();
    },
    error: (err) => {
      console.error(err);
    }
  });
}

Any ideas what might be causing this error? Could it be a problem with how the server was rebuilt?

Thanks in advance!

Anton Tananaev8 days ago

The error indicates that you're using token auth, not user and password.