reddit-app's People
Forkers
kamil-khamidullin michellebon gak21 friquerette peterbjo muthhus supernova2819 mgashraf leoundercover hanibalus radari longbaobao amilabanuka ronysebastian javen-hao vinodkandula jangheosoo gokhanbirincii asitti xinsfang jeperez gpierre92 psumanth ashutosh049 prolificsumit adryanf sekharpatil avbaykov ptzagk mamir-legalhero sangkyunyoon dalalsunil1986 docertabum kinowarrior arvindve nick130589 pjoshi1 arpan-banerjee7 deepaksorthiya phanesh-mallampati myittoolbox sonuahluwalia clozanoga dhoolmahe jesshaw lentiummmx javalyricist malkinfedor bostandyksoft sac10nikam ramanujadasu sffej mehran-at johnjonathan calime300 syedabdullahrahman waititu anuragkumawat brendenvogt arberestoreddit-app's Issues
Differences between code and article in the Spring Security setup
I read https://www.baeldung.com/spring-security-oauth2-authentication-with-reddit in order to understand how to implement OAuth in a legacy Spring (no Boot, Spring Security 4.x) web application but seems like the code doesn't match the article.
esp.
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
/* ... */
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.anonymous().disable()
.csrf().disable()
.authorizeRequests()
.antMatchers("/home.html").hasRole("USER")
.and()
.httpBasic()
.authenticationEntryPoint(oauth2AuthenticationEntryPoint());
}
private LoginUrlAuthenticationEntryPoint oauth2AuthenticationEntryPoint() {
return new LoginUrlAuthenticationEntryPoint("/login");
}
}
which makes use of .authenticationEntryPoint()
method + a LoginUrlAuthenticationEntryPoint
object,
@Configuration
@EnableWebSecurity
@ComponentScan({ "org.baeldung.security" })
public class GeneralSecurityConfig extends WebSecurityConfigurerAdapter {
/* ... */
@Override
protected void configure(final HttpSecurity http) throws Exception {
// @formatter:off
http.anonymous().disable().csrf().disable().authorizeRequests()
.antMatchers("/api/*","/feedForm","/profile","/scheduledPosts","/feeds","/changePassword","/updatePassword").authenticated()
.antMatchers("/adminHome","/users").hasAuthority("USER_READ_PRIVILEGE")
.and()
.formLogin().loginPage("/").loginProcessingUrl("/j_spring_security_check").defaultSuccessUrl("/home")
.failureUrl("/?error").usernameParameter("username").passwordParameter("password")
.successHandler(successHandler)
.and()
.logout().invalidateHttpSession(true).deleteCookies("JSESSIONID").logoutUrl("/logout").logoutSuccessUrl("/")
.and()
.sessionManagement().sessionFixation().none().maximumSessions(1).maxSessionsPreventsLogin(true);
// @formatter:on
}
}
calls .formLogin()
loginPage()
failureUrl()
and so on...
setupData
How are you handling setup data with liquibase, I can see the folder but I cannot see how you used it
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.