#Spring OAuth2 with SSO and Cloud Config, but no Eureka
That config-repo path is relative using the $PWD environment variable. If you are running this on Windows you'll need to fix this path for your operating system. The code snippet below is from the the config-service main application.yml.
spring:
cloud:
config:
server:
native:
search-locations: file://${pwd}/../config-repo
Also, the Config Service is running in native mode, which is only suitable for testing. Use a Git repository in non-Dev environments.
- cd ./spring-oauth2-sso-config-no-eureka/authentication-service
- mvn spring-boot:run
- cd ./spring-oauth2-sso-config-no-eureka/protected-web-site
- npm install
- ng serve --baseHref=/protected-web-site/ --port=9001
- /spring-oauth2-sso-config-no-eureka/proxy-service
- mvn spring-boot:run
- Angular - Open the Angular App directly: http://localhost:9001/protected-web-site/
- Authentication Server - Get an access token from the authentication server (see curl command below)
- Proxy with SSO - Access the Angular App via the proxy: http://localhost:9000/protected-web-site
curl --user zuul-proxy-example:client-secret \
http://localhost:9002/oauth/token \
-d 'grant_type=password&client_id=zuul-proxy-example&username=user&password=password'
- User tries to access the protected web site via authentication SSO-enabled proxy server, http://localhost:9000/protected-web-site/
- Spring Security on the proxy server redirects the user's browser to the Login page on the authentication server (http://localhost:9002/login).
- The user signs in and posts the Login form to the authentication server.
- The authentication server redirects the user to the login page on the proxy service passing a JSESSIONID (http://localhost:9000/login)
- The proxy server login page bypasses the 3rd Party Permission page and redirects the browser to the protected resource URL (/protected-web-site/).
- The http://localhost:9000/protected-web-site/ is displayed.