diff options
| author | Kamal Wickramanayake <kamal@inbox.lk> | 2026-07-03 19:02:36 +0530 |
|---|---|---|
| committer | Kamal Wickramanayake <kamal@inbox.lk> | 2026-07-03 19:02:36 +0530 |
| commit | aa122113ade36f02dc8fdbebdf1232b5c4b8742c (patch) | |
| tree | c345b83db6c769bf5e72a09e3f19d43431961695 /microservices/01-oauth2-server/src/main/resources | |
| parent | b221a83ecef1dd7f9583d5107017d24e668205a6 (diff) | |
Microservice sample projects
Diffstat (limited to 'microservices/01-oauth2-server/src/main/resources')
| -rw-r--r-- | microservices/01-oauth2-server/src/main/resources/application.yaml | 39 | ||||
| -rw-r--r-- | microservices/01-oauth2-server/src/main/resources/templates/error.html | 26 |
2 files changed, 65 insertions, 0 deletions
diff --git a/microservices/01-oauth2-server/src/main/resources/application.yaml b/microservices/01-oauth2-server/src/main/resources/application.yaml new file mode 100644 index 0000000..b263a5e --- /dev/null +++ b/microservices/01-oauth2-server/src/main/resources/application.yaml @@ -0,0 +1,39 @@ +server: + port: 8051 + address: 127.0.0.1 + +#logging: +# level: +# org.springframework.security: trace + +spring: + application: + name: oauth2-server + security: + oauth2: + authorizationserver: + client: + oidc-client: + registration: + client-id: "api-gateway" + client-secret: "{noop}apiGatewayPassword1234" + client-authentication-methods: + - "client_secret_basic" + authorization-grant-types: + - "authorization_code" + - "refresh_token" + redirect-uris: + - "http://localhost:5173/bff/login/oauth2/code/api-gateway" + post-logout-redirect-uris: + - "http://localhost:5173/" + scopes: + - "openid" + - "profile" + require-authorization-consent: false + +app: + users: + - username: admin + password: "{noop}abc123" + - username: user1 + password: "{noop}abc123" diff --git a/microservices/01-oauth2-server/src/main/resources/templates/error.html b/microservices/01-oauth2-server/src/main/resources/templates/error.html new file mode 100644 index 0000000..f97dc77 --- /dev/null +++ b/microservices/01-oauth2-server/src/main/resources/templates/error.html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html xmlns:th="http://thymeleaf.org" xmlns:sec="http://thymeleaf.org/extras/spring-security"> + +<head> + <title>An Error Occurred</title> +</head> + +<body> + <h1>Something went wrong!</h1> + <p>Status: <span th:text="${status}">500</span></p> + <p>Error: <span th:text="${error}">Internal Server Error</span></p> + <p>Message: <span th:text="${message}">Unexpected error</span></p> + <p>Path: <span th:text="${path}">/</span></p> + + <a th:href="@{/}">Back to Home</a> + + <div sec:authorize="isAuthenticated()" style="padding-top: 10px;"> + <form th:action="@{/logout}" method="post"> + <button type="submit"> + Logout + </button> + </form> + </div> +</body> + +</html>
\ No newline at end of file |
