Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
browser-backend
Commits
5151c880
Commit
5151c880
authored
Mar 12, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oauth认证bug
parent
66be1dde
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
8 deletions
+13
-8
ResourceServerConfiguration.java
...owserbackend/auth/config/ResourceServerConfiguration.java
+9
-6
WebSecurityConfig.java
...m/edgec/browserbackend/auth/config/WebSecurityConfig.java
+4
-2
No files found.
src/main/java/com/edgec/browserbackend/auth/config/ResourceServerConfiguration.java
View file @
5151c880
...
@@ -17,12 +17,14 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter
...
@@ -17,12 +17,14 @@ public class ResourceServerConfiguration extends ResourceServerConfigurerAdapter
@Override
@Override
public
void
configure
(
HttpSecurity
http
)
throws
Exception
{
public
void
configure
(
HttpSecurity
http
)
throws
Exception
{
http
.
exceptionHandling
()
http
.
and
()
.
logout
()
.
logoutUrl
(
"/oauth/logout"
)
.
and
()
.
authorizeRequests
()
.
authorizeRequests
()
.
antMatchers
(
"/secure/**"
).
authenticated
();
.
antMatchers
(
"/user/*"
)
.
authenticated
()
.
antMatchers
(
"/oauth/**"
).
permitAll
()
.
antMatchers
(
"/shop/*"
,
"/ip/*"
,
"/group/*"
).
authenticated
()
.
and
()
//关闭跨站请求防护
.
csrf
().
disable
();
}
}
}
}
\ No newline at end of file
src/main/java/com/edgec/browserbackend/auth/config/WebSecurityConfig.java
View file @
5151c880
...
@@ -8,12 +8,14 @@ import org.springframework.security.authentication.AuthenticationManager;
...
@@ -8,12 +8,14 @@ import org.springframework.security.authentication.AuthenticationManager;
import
org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder
;
import
org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.builders.HttpSecurity
;
import
org.springframework.security.config.annotation.web.builders.WebSecurity
;
import
org.springframework.security.config.annotation.web.builders.WebSecurity
;
import
org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
import
org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
/**
/**
* @author cdov
* @author cdov
*/
*/
@EnableWebSecurity
@Configuration
@Configuration
public
class
WebSecurityConfig
extends
WebSecurityConfigurerAdapter
{
public
class
WebSecurityConfig
extends
WebSecurityConfigurerAdapter
{
...
@@ -30,8 +32,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
...
@@ -30,8 +32,8 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
public
void
configure
(
WebSecurity
web
)
throws
Exception
{
public
void
configure
(
WebSecurity
web
)
throws
Exception
{
web
.
ignoring
()
web
.
ignoring
()
.
antMatchers
(
"/
account/authCode"
,
"/user/signu
p"
,
.
antMatchers
(
"/
user/authCode"
,
"/user/signU
p"
,
"/user/reset*"
,
"/token"
);
"/user/reset*"
);
}
}
@Override
@Override
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment