Restructure samples
Closes gh-485
This commit is contained in:
13
samples/README.adoc
Normal file
13
samples/README.adoc
Normal file
@@ -0,0 +1,13 @@
|
||||
= Messages Sample
|
||||
|
||||
This sample integrates `spring-security-oauth2-client` and `spring-security-oauth2-resource-server` with *Spring Authorization Server*.
|
||||
|
||||
The username is `user1` and the password is `password`.
|
||||
|
||||
== Run the Sample
|
||||
|
||||
* Run Authorization Server -> `./gradlew -b samples/default-authorizationserver/samples-default-authorizationserver.gradle bootRun`
|
||||
** *IMPORTANT:* Make sure to modify your `/etc/hosts` file to avoid problems with session cookie overwrites between `messages-client` and `default-authorizationserver`. Simply add the entry `127.0.0.1 auth-server`
|
||||
* Run Resource Server -> `./gradlew -b samples/messages-resource/samples-messages-resource.gradle bootRun`
|
||||
* Run Client -> `./gradlew -b samples/messages-client/samples-messages-client.gradle bootRun`
|
||||
* Go to `http://127.0.0.1:8080`
|
||||
@@ -1,13 +0,0 @@
|
||||
= OAuth 2.0 Integration Sample
|
||||
|
||||
This sample integrates `spring-security-oauth2-client` and `spring-security-oauth2-resource-server` with *Spring Authorization Server*.
|
||||
|
||||
The username is `user1` and the password is `password`.
|
||||
|
||||
== Run the Sample
|
||||
|
||||
* Run Authorization Server -> `./gradlew -b samples/boot/oauth2-integration/authorizationserver/spring-security-samples-boot-oauth2-integrated-authorizationserver.gradle bootRun`
|
||||
** *IMPORTANT:* Make sure to modify your `/etc/hosts` file to avoid problems with session cookie overwrites between `client` and `authorizationserver`. Simply add the entry `127.0.0.1 auth-server`
|
||||
* Run Resource Server -> `./gradlew -b samples/boot/oauth2-integration/resourceserver/spring-security-samples-boot-oauth2-integrated-resourceserver.gradle bootRun`
|
||||
* Run Client -> `./gradlew -b samples/boot/oauth2-integration/client/spring-security-samples-boot-oauth2-integrated-client.gradle bootRun`
|
||||
* Go to `http://127.0.0.1:8080`
|
||||
@@ -22,10 +22,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
* @author Daniel Garnier-Moiroux
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class OAuth2AuthorizationServerCustomConsentPageApplication {
|
||||
public class CustomConsentAuthorizationServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(OAuth2AuthorizationServerCustomConsentPageApplication.class, args);
|
||||
SpringApplication.run(CustomConsentAuthorizationServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -50,7 +50,7 @@ import static org.mockito.Mockito.when;
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@AutoConfigureMockMvc
|
||||
public class OAuth2AuthorizationServerCustomConsentTests {
|
||||
public class CustomConsentAuthorizationServerTests {
|
||||
|
||||
@Autowired
|
||||
private WebClient webClient;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 the original author or authors.
|
||||
* Copyright 2020-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,10 +23,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
* @since 0.0.1
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class OAuth2AuthorizationServerApplication {
|
||||
public class DefaultAuthorizationServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(OAuth2AuthorizationServerApplication.class, args);
|
||||
SpringApplication.run(DefaultAuthorizationServerApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -45,7 +45,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@AutoConfigureMockMvc
|
||||
public class OAuth2AuthorizationServerApplicationTests {
|
||||
public class DefaultAuthorizationServerApplicationTests {
|
||||
private static final String REDIRECT_URI = "http://127.0.0.1:8080/login/oauth2/code/messaging-client-oidc";
|
||||
|
||||
private static final String AUTHORIZATION_REQUEST = UriComponentsBuilder
|
||||
@@ -50,7 +50,7 @@ import static org.mockito.Mockito.when;
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
@AutoConfigureMockMvc
|
||||
public class OAuth2AuthorizationServerConsentTests {
|
||||
public class DefaultAuthorizationServerConsentTests {
|
||||
|
||||
@Autowired
|
||||
private WebClient webClient;
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 the original author or authors.
|
||||
* Copyright 2020-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,10 +23,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
* @since 0.0.1
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class OAuth2ClientApplication {
|
||||
public class MessagesClientApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(OAuth2ClientApplication.class, args);
|
||||
SpringApplication.run(MessagesClientApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2020 the original author or authors.
|
||||
* Copyright 2020-2021 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -23,10 +23,10 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
* @since 0.0.1
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class OAuth2ResourceServerApplication {
|
||||
public class MessagesResourceApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(OAuth2ResourceServerApplication.class, args);
|
||||
SpringApplication.run(MessagesResourceApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user