I used your library and it works fine. but problem is when I refresh the active page, Bearer token expires and it asks user again to login. How this can be avoided.
Also, when someone is trying to hit URL without login, you are showing fallback page? How did you configure that?
I was using your application to learn about JWT with Spring Boot but I came across a scenario while passing the token in headers.
In the JwtFilter.java, request.getHeader("Authorization"); always returned null.
Can you please suggest what could be the issue as I just cloned the app & didn't do any changes.
I have created build using maven clean package
now when i am executing it using java -jar ..... it is throwing exception as -
Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:686)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:957)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:946)
at com.example.WebApplication.main(WebApplication.java:24)
it's not an issue rather than a question.
What changes would it need to also send the password on the login form?
I am guessing it has to be encoded and also the rest controller to parse it appropriately right?