question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enable VaadinWebSecurity to use JWT coming from a Filter

See original GitHub issue

In some scenarios, a Vaadin application may be called with a valid JWT in the header.

For that a Filter is used that populates the SecurityContext like in this example: https://github.com/simasch/spring-jwt

Now when using VaadinWebSecurity this approach may not work because the JWT must be used in the browser code and sent back to the server with every request.

Currently, we have to create our own security configuration in this scenario, but then we cannot use annotation-based security.

Please add support for such a scenario.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
simaschcommented, Dec 14, 2022

@gsustek I think my initial statement is wrong. We CAN use annotation-based security but we still need our own filter because we must add some roles. But I definitely have to check the resource server configuration

0reactions
gsustekcommented, Dec 14, 2022

@simasch Can you please explain a little bit more with examples why

Currently, we have to create our own security configuration in this scenario, but then we cannot use annotation-based security. becasue, “Vaadin has a spring security integration and is able to use the spring security annotations.”

Does this influence resourceServer springsecurity configuration case only?

Regards, Goran.

In some scenarios, a Vaadin application may be called with a valid JWT in the header.

For that a Filter is used that populates the SecurityContext like in this example: https://github.com/simasch/spring-jwt

Now when using VaadinWebSecurity this approach may not work because the JWT must be used in the browser code and sent back to the server with every request.

Currently, we have to create our own security configuration in this scenario, but then we cannot use annotation-based security.

Please add support for such a scenario.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding a JWT Filter for Spring Security - YouTube
In this lesson we will add a custom filter to Spring Security which will validate a Json Web Token ( JWT ) and...
Read more >
Jwt filter accessed even on permitted urls - Stack Overflow
The problem that I have is that the ant matcher described in my configuration class are also intercepted by the filter even if...
Read more >
Spring Security JWT Tutorial - Toptal
This chain consists of various filters, and each of them handles a particular use case. For example: Check if the requested URL is...
Read more >
How to secure stream with JWT Stream Security Filter
The newest feature of our secure stream series. We'll be walking you through steps of how to enable and use the JWT Stream...
Read more >
How to Set Up Java Spring Boot JWT Authorization and ...
Here we specify the secure endpoints and filters that we want to apply. We configure CORS, and then we permit all post requests...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found