Could you provide one example for Authentication and Authorization?
Did you check this discussion Discord
sir how can i keep a user logged in pwa until he logs out?
and also i want to stay logged in while surveres restarting time
sir, i added PWA and set JWT expiration like @EnableWebSecurity
@Configuration
public class SecurityConfiguration extends VaadinWebSecurity {
// The secret is stored in /config/secrets/application.properties by default.
// Never commit the secret into version control; each environment should have
// its own secret.
@Value("${com.example.application.auth.secret}")
private String authSecret;
@Bean
public PasswordEncoder passwordEncoder() {
return new BCryptPasswordEncoder();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeHttpRequests(
authorize -> authorize
.requestMatchers(new AntPathRequestMatcher("/images/*.png")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/line-awesome/**/*.svg")).permitAll()
.anyRequest().authenticated()
);
super.configure(http);
http.sessionManagement(customizer -> customizer.sessionCreationPolicy(SessionCreationPolicy.STATELESS));
setLoginView(http, "/login");
setStatelessAuthentication(http, new SecretKeySpec(Base64.getDecoder().decode(authSecret), JwsAlgorithms.HS256),
"com.example.application", 31536000);
}
} this. Now iam facing an issue that when i logged out and project restarted , it going to the logged page .I think username and password storing the storage.When i cleared the cache storage it working.How can i clear the storage when i click logout button or if it is not this issue ,then how to overcome that? please help me!