Add @EnableOAuth2Sso and spring.oauth2.sso.*
User can enable OAuth2 SSO by declaring the intent (@EnableOAuth2Sso) and also configuring the client properties (spring.oauth2.client.*). The spring.oauth2.sso.* are only needed to change the path for the login (defaults to /login) - any other security configuration for the protected resources can be added in a WebSecurityConfigurerAdapter which carries the @EnableOAuth2Sso annotation.
This commit is contained in:
@@ -16,6 +16,11 @@
|
||||
|
||||
package org.springframework.boot.cli;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
|
||||
@@ -23,11 +28,6 @@ import org.junit.Ignore;
|
||||
import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
|
||||
import static org.hamcrest.Matchers.containsString;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
/**
|
||||
* Integration tests to exercise the samples.
|
||||
*
|
||||
@@ -70,15 +70,10 @@ public class SampleIntegrationTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Ignore("Spring Security Oauth2 autoconfiguration reports bean creation issue with methodSecurityInterceptor")
|
||||
public void oauth2Sample() throws Exception {
|
||||
String output = this.cli.run("oauth2.groovy");
|
||||
assertTrue("Wrong output: " + output, output.contains("spring.oauth2.clientId"));
|
||||
assertTrue("Wrong output: " + output, output.contains("spring.oauth2.secret = ****"));
|
||||
assertTrue("Wrong output: " + output, output.contains("spring.oauth2.resourceId"));
|
||||
assertTrue("Wrong output: " + output, output.contains("spring.oauth2.authorizationTypes"));
|
||||
assertTrue("Wrong output: " + output, output.contains("spring.oauth2.scopes"));
|
||||
assertTrue("Wrong output: " + output, output.contains("spring.oauth2.redirectUris"));
|
||||
assertTrue("Wrong output: " + output, output.contains("spring.oauth2.client.clientId"));
|
||||
assertTrue("Wrong output: " + output, output.contains("spring.oauth2.client.secret ="));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user