[Vuejs]-Username and password have been treated as anonymous in Spring-security-oauth2 password mode

0👍

I think problem with Content-Type: application/x-www-form-urlencoded. If you send json, you need to use Content-Type: application/json.
Simple use of axios with post of json:

axios.post("http://localhost:8080/oauth/token", { 
  "grant_type": "password",
  "scope": "all",
  "username": "admin",
  "password": "888",
  "client_id": "wellcell",
  "client_secret": "wellcell"
}).then((response) => {
  console.log(response.data);
});

Leave a comment