java - Generating Token (JWT) in Spring -


i building first spring rest api. have made registration , login, time secure these processes. store users informations , passwords (hashed) in database.

i did this:

@override protected void configure(httpsecurity http) throws exception {      http.authorizerequests()            .antmatchers("/register","/login").permitall()             .anyrequest().authenticated().and()             .csrf().disable();              } 

it gives permission access login/register , blocks other request. want use jwt , keep access functions logged in users. there easy way it? maybe has materials on it? thankful.

ps. have followed tutorial here, , i've ended being able create , pass token, think "overrides" service implementation, returns empty response (token in header) , has hard coded credentials. want sent user custom response + token in header.


Comments

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -