-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to set Angular OAuth2 login page (backwards compatible with Spring-Security default OAuth2 login) #1887
Comments
@klopfdreh Thanks Tobias for finding this, Thanks |
It is just /login with OAuth2 configured. I am also going to search for it. 👍 |
@klopfdreh It seems there's no route associated in the Angular code. |
Yes but the default redirection {baseUrl}/login/oauth2/code/{registrationId} points to the scdf server itself. I guess it is the default login page of Spring Security OAuth2 / Spring Security. |
Yep, same guess on my side. So I believe this same issue should be moved to Spring Security. |
Found it (I guess) - the class is called It is also responsible for OAuth2 authentication, because it provides and it matches Edit: Use permanent links at references. Maybe it would be good to create a custom login form that also uses the login page of the SCDF and Angular: https://docs.spring.io/spring-security/reference/servlet/authentication/passwords/form.html When you click on logout, then you are redirected to a login page which is styled with Spring Cloud Data Flow lookup. The only thing which has to be adjusted would be to show the So basically if you only provide OAuth2 as authorization standard create a form that is created the same way as in this method: Last edit: I don't think this is an Spring Security issue, because they only provide a Default-Implementation. I guess the customization should be in Spring Cloud Data Flow and should not use Bootstrap but Angular as presentation layer. |
Exactly. I found the same files on the Spring Security repository. I see clearly they're injecting there the bootstrap minified css. |
So based on the things we found out I would suggest:
Because it is a login page, it should be excluded from redirection to the login page from the UI. Also be aware of CSRF Tokens which are checked by Spring Security. the good thing is that you have full control over the appearance of the login and you can design it the SCDF-way. |
Thanks for the analysis and suggested plan @klopfdreh . I am marking this for team meeting and we will discuss further. I will keep you posted on the direction w/ an update here in this ticket. |
Thanks again! 😀 I guess it is a mediocre effort but improves the appearance a lot. If I can assist just let me know. |
Spring security referenced issue spring-projects/spring-security#11949 |
We believe the simplest solution would be is to change the styling to use the same CSS styling as the rest of the application and remove any dependance on Bootstrap. |
Hey @corneil - just want to mention that you can only style the login yourself if you create a custom login page - otherwise you can not get CSS into the page because it is rendered by Spring Security. But if there is any way I would be very interested in learning how to do so. |
From my understanding, we have to customise Spring Security Settings (create a custom login page). |
Investigating options for customising login page while remaining compatible with Spring Security variations without replicating all of Spring Security Filters etc. |
Great! Thanks a lot for all the effort. May I don't know all places which are relevant for those changes, but I think this would be a good place: https://github.com/spring-cloud/spring-cloud-dataflow/blob/main/spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/config/DataflowOAuthSecurityConfiguration.java - in here you can permit all requests to the login page http.authorizeRequests().antMatchers("/login*").permitAll(); Because the context path is also included in this pattern as it only means / with context root - this should work. As I saw here: https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#configuration-security-oauth2 - Further more it would be great when this login screen could be used: I created a prototype: This login page is shown when I press logout in the Spring Cloud Data Flow UI and is already styled in a nice way. |
@klopfdreh this did not fit into the current release candidate. However, we will pursue this issue as one of the high priority items post |
@onobc all right! Thanks for the information! |
As mentioned here #1867 - bootstrap shouldn't be used and removed.
When I tested Spring Cloud Data Flow Server 2.10.0-M2 and used a custom
DataflowOAuthSecurityConfiguration
for CSP settings, I found the login page to still use bootstrap.The text was updated successfully, but these errors were encountered: