I have searched the forums and Google, and don’t see anything but unanswered questions on how to get a Vaadin app working with OAuth2, especially using the Spring Security implementation.
It seems this is a pretty crucial and common use case - my application will need to support both internally managed logins - which I can implement using Spring Security (and I have this working) - as well as SSO logins from various sources (notably Okta and Azure AD).
Is there any guidance anyone can point me to to get this working?
Would love Vaadin to include OAuth2 component or at least an example. Vaadin.com supports login with Google and what not and assuming that Vaadin.com runs on Flow, why not make it reusable?
sorry, I was on vacation and now we first have to get used to Corona/Covid consequences at home…
Anyway, we are right now moving to CAS as our central authentication service at Vaadin. That is also why I asked if Ken considered using this approach. In yes, the plan is to create a dedicated tutorial about it.
The current approach uses Spring Security provided SSO stuff but for enterprise level this approach is quite limited when more than one service (like the website) needs authentication/authorization capabilities.
But how does Vaadin work with OAuth2. I understand I can use Spring MVC for the login dialog (which I already do) but once authenticated the Vaadin requests would need to add the Authorization: Bearer header and not rely on cookies to work correctly. I’m looking at OAuth2 JWT tokens to be able to seamlessly login to multiple servers should one server fail and use sticky sessions to keep the users on the same server as long as it’s available. This is necessary due to the complexities of serializing the Vaadin session across servers as it’s never worked right.
Your examples worked perfect with the integration with Spring Security (both ways: using Vaadin LoginPanel or using Spring MVC Thymeleaf). My problem is when I´ve have PWAs ad I want to implement SSO (Single Sing on) I tried many ways but as soon as I inserted @EnableOAuth2Sso in my WebSecurityConfigurationAdapter I ran into many problems. I tryied to use Thymeleaf and Vaadin login view and could not make it work.
Any ideas how can I get PWAs with SSO? Do you have an example?
Thanks in advance