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
6be43077
Commit
6be43077
authored
Aug 21, 2018
by
artsiom
Committed by
Madhura Bhave
Aug 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
OAuth2 client secret property should not be required
parent
caf72214
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
OAuth2ClientProperties.java
...figure/security/oauth2/client/OAuth2ClientProperties.java
+1
-3
OAuth2ClientPropertiesTests.java
...e/security/oauth2/client/OAuth2ClientPropertiesTests.java
+2
-3
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientProperties.java
View file @
6be43077
...
@@ -30,6 +30,7 @@ import org.springframework.util.StringUtils;
...
@@ -30,6 +30,7 @@ import org.springframework.util.StringUtils;
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @author Phillip Webb
* @author Phillip Webb
* @author Artsiom Yudovin
*/
*/
@ConfigurationProperties
(
prefix
=
"spring.security.oauth2.client"
)
@ConfigurationProperties
(
prefix
=
"spring.security.oauth2.client"
)
public
class
OAuth2ClientProperties
{
public
class
OAuth2ClientProperties
{
...
@@ -61,9 +62,6 @@ public class OAuth2ClientProperties {
...
@@ -61,9 +62,6 @@ public class OAuth2ClientProperties {
if
(!
StringUtils
.
hasText
(
registration
.
getClientId
()))
{
if
(!
StringUtils
.
hasText
(
registration
.
getClientId
()))
{
throw
new
IllegalStateException
(
"Client id must not be empty."
);
throw
new
IllegalStateException
(
"Client id must not be empty."
);
}
}
if
(!
StringUtils
.
hasText
(
registration
.
getClientSecret
()))
{
throw
new
IllegalStateException
(
"Client secret must not be empty."
);
}
}
}
/**
/**
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/oauth2/client/OAuth2ClientPropertiesTests.java
View file @
6be43077
...
@@ -24,6 +24,7 @@ import org.junit.rules.ExpectedException;
...
@@ -24,6 +24,7 @@ import org.junit.rules.ExpectedException;
* Tests for {@link OAuth2ClientProperties}.
* Tests for {@link OAuth2ClientProperties}.
*
*
* @author Madhura Bhave
* @author Madhura Bhave
* @author Artsiom Yudovin
*/
*/
public
class
OAuth2ClientPropertiesTests
{
public
class
OAuth2ClientPropertiesTests
{
...
@@ -44,13 +45,11 @@ public class OAuth2ClientPropertiesTests {
...
@@ -44,13 +45,11 @@ public class OAuth2ClientPropertiesTests {
}
}
@Test
@Test
public
void
clientSecretAbsentThrowsException
()
{
public
void
clientSecretAbsent
Not
ThrowsException
()
{
OAuth2ClientProperties
.
Registration
registration
=
new
OAuth2ClientProperties
.
Registration
();
OAuth2ClientProperties
.
Registration
registration
=
new
OAuth2ClientProperties
.
Registration
();
registration
.
setClientId
(
"foo"
);
registration
.
setClientId
(
"foo"
);
registration
.
setProvider
(
"google"
);
registration
.
setProvider
(
"google"
);
this
.
properties
.
getRegistration
().
put
(
"foo"
,
registration
);
this
.
properties
.
getRegistration
().
put
(
"foo"
,
registration
);
this
.
thrown
.
expect
(
IllegalStateException
.
class
);
this
.
thrown
.
expectMessage
(
"Client secret must not be empty."
);
this
.
properties
.
validate
();
this
.
properties
.
validate
();
}
}
...
...
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