Login com Spring oauth2 e angular - resolvido

Estou tentando fazer login no spring oauth2

const body = new HttpParams()
      .set('username', credentials.login)
      .set('password', credentials.senha)
      .set('grant_type', 'password');
    let a = btoa(
      'sistemaOnLine:$2a$10$LOtptpML.31/npNP4Z87vOEjctNXa9FMA29a.G0D8nj9Zq1nlMMjK'
    );
    const headers = {
      Authorization: 'Basic ' + a,
      'Content-type': 'application/x-www-form-urlencoded',
    };
    return this.http
      .post<any>('http://localhost:8200/oauth-api/oauth/', body.toString(), { headers })
      .pipe(map((response) => this.authenticateSuccess(response, true)));

Só que dá erro 404

const headers = new HttpHeaders({
      Authorization: 'Basic ' + btoa('sistemaOnLine:123'),
});
let options = {
      headers: headers,
};
 return this.http
      .post<any>(
         'http://localhost:8200/oauth-api/oauth/token?' +
          'grant_type=password' +
          '&username=' + 
          credentials.login + 
         '&password=' + 
         credentials.senha,
        {},
        options
      )
      .pipe(map((response) => this.authenticateSuccess(response, true)));
  }