Using Vue.js I am trying to implement a JWT login form in a RESTful API with Spring Boot, but unless I add the bearer token to the request, all I get is a 403 status. I have set the endpoint to be accesible without any clearance, and on postman it's possible to send the request without the authorization header. This is a part of my security configuration on Spring:
.antMatchers(HttpMethod.POST, "/auth/login")
.permitAll()
And this is the vue.js service where I make the POST request:
import axios from 'axios'
let USER_API_BASE_URL = 'http://localhost:8080/auth/login/'
let config = {
headers: {
'Content-Type': 'application/json',
'Authorization': "Bearer (hereGoesTheToken)"
}}
class LoginService{
postLogin(emailInput, passwordInput){
let user = JSON.stringify({email: emailInput, password: passwordInput});
var response = axios.post(USER_API_BASE_URL, user, config);
console.log(response)
return response
}
}
export default new LoginService()
I want to make it so there's no need for a token in order to have access to the part where you request that same token... is there any way to do this?