Skip to content

Commit 5b6782f

Browse files
committed
now am i able to authenticate
1 parent bef3a1b commit 5b6782f

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

src/main/java/ru/techdemo/security/ResourceServerConfigAdapter.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ public class ResourceServerConfigAdapter extends ResourceServerConfigurerAdapter
2626
public void configure(HttpSecurity http) throws Exception {
2727
http.csrf().disable()
2828
.authorizeRequests()
29-
.antMatchers("/api/**",
30-
"/login").authenticated()
29+
.antMatchers("/api/**", "/login").authenticated()
3130
.anyRequest().authenticated().and()
3231
.logout().permitAll().logoutSuccessUrl("/");
3332
}

src/main/java/ru/techdemo/security/config/AppSecurityExtServiceConfigAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class AppSecurityExtServiceConfigAdapter extends WebSecurityConfigurerAda
3434
@Override
3535
protected void configure(HttpSecurity http) throws Exception {
3636
http.sessionManagement()
37-
.sessionCreationPolicy(SessionCreationPolicy.STATELESS)
37+
.sessionCreationPolicy(SessionCreationPolicy.ALWAYS)
3838
.and()
3939
.authorizeRequests()
4040
.antMatchers("/api/**").authenticated()

src/main/resources/application.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ security:
1212
username: mjolnir
1313
password: 12345678
1414
## tokenName: accessToken
15-
redirectUri: https://localhost:8080/api/users
15+
## redirectUri: http://localhost:8080/api/users
1616
## authenticationScheme: query
1717
## clientAuthenticationScheme: header
1818
resource:
19-
userInfoUri: http://localhost:8899/OpenAM-14.4.2/oauth2/userinfo
19+
userInfoUri: http://localhost:8899/OpenAM-14.4.2/oauth2/userinfo?realm=abcdemo
2020
logging:
2121
level:
2222
org:

0 commit comments

Comments
 (0)