Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
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
DEMO
spring-boot
Commits
6253cc5d
Commit
6253cc5d
authored
Feb 19, 2015
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.1.x'
parents
67ec89e7
df81b314
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
AuthenticationManagerConfiguration.java
...onfigure/security/AuthenticationManagerConfiguration.java
+14
-10
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/AuthenticationManagerConfiguration.java
View file @
6253cc5d
...
...
@@ -69,13 +69,14 @@ public class AuthenticationManagerConfiguration {
@Bean
@Primary
public
AuthenticationManager
authenticationManager
(
AuthenticationConfiguration
auth
)
throws
Exception
{
public
AuthenticationManager
authenticationManager
(
AuthenticationConfiguration
auth
)
throws
Exception
{
return
auth
.
getAuthenticationManager
();
}
@Bean
public
static
BootDefaultingAuthenticationConfigurerAdapter
bootDefaultingAuthenticationConfigurerAdapter
(
SecurityProperties
security
,
List
<
SecurityPrerequisite
>
dependencies
)
{
public
static
BootDefaultingAuthenticationConfigurerAdapter
bootDefaultingAuthenticationConfigurerAdapter
(
SecurityProperties
security
,
List
<
SecurityPrerequisite
>
dependencies
)
{
return
new
BootDefaultingAuthenticationConfigurerAdapter
(
security
);
}
...
...
@@ -126,7 +127,8 @@ public class AuthenticationManagerConfiguration {
* </ul>
*/
@Order
(
Ordered
.
LOWEST_PRECEDENCE
-
100
)
private
static
class
BootDefaultingAuthenticationConfigurerAdapter
extends
GlobalAuthenticationConfigurerAdapter
{
private
static
class
BootDefaultingAuthenticationConfigurerAdapter
extends
GlobalAuthenticationConfigurerAdapter
{
private
final
SecurityProperties
security
;
@Autowired
...
...
@@ -134,6 +136,7 @@ public class AuthenticationManagerConfiguration {
this
.
security
=
security
;
}
@Override
public
void
init
(
AuthenticationManagerBuilder
auth
)
throws
Exception
{
if
(
auth
.
isConfigured
())
{
return
;
...
...
@@ -144,12 +147,13 @@ public class AuthenticationManagerConfiguration {
logger
.
info
(
"\n\nUsing default security password: "
+
user
.
getPassword
()
+
"\n"
);
}
Set
<
String
>
roles
=
new
LinkedHashSet
<
String
>(
user
.
getRole
());
auth
.
inMemoryAuthentication
()
.
withUser
(
user
.
getName
())
.
password
(
user
.
getPassword
())
.
roles
(
roles
.
toArray
(
new
String
[
roles
.
size
()]));
auth
.
inMemoryAuthentication
().
withUser
(
user
.
getName
())
.
password
(
user
.
getPassword
())
.
roles
(
roles
.
toArray
(
new
String
[
roles
.
size
()]));
}
}
}
\ No newline at end of file
}
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