I have written a REST call as shown below
authenticateUser(username: string, password: string) {
debugger;
let params = new HttpParams();
params = params.append('username', username);
params = params.append('password', password);
return this.http.get(`http://localhost:8080/api/v1/basicauth?`,{params},
).pipe(map((res) => {
this.username = username;
this.password = password;
}));
}
On the Spring Boot side, I am using @RequestParams as follows
@GetMapping(path = "/basicauth")
public AuthenticationBean getAuthenticatedUser(@RequestParam(name = "username") String username,@RequestParam(name = "password") String password) {
String status = authenticationService.isUserAuthenticated(username, password);
return new AuthenticationBean("You are not authenticated");
}
I encountered an error like
Please assist me with this. Thank you:)