Skip to content

Commit

Permalink
#1591 added docker-compose.yml for starting a mock oauth2 server in o…
Browse files Browse the repository at this point in the history
…rder to test SSO in Ditto UI
  • Loading branch information
thjaeckle committed Sep 27, 2024
1 parent a9fb98f commit 5601fc5
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 0 deletions.
39 changes: 39 additions & 0 deletions ui/sso-test/app/login.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Mock OAuth2 Server Example Sign-in</title>

<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>

<body>
<div class="container">
<div class="row mt-5 justify-content-md-center">
<div class="col-md-5">
<form method="post">
<div></div>
<h4>Mock OAuth2 Server Example</h4>
<hr class="divisor">
<div class="form-group">
<input type="text" class="form-control" name="username" autofocus="on"
placeholder="Enter any user/subject">
</div>
<div class="form-group">
<textarea class="form-control" name="claims" rows="15" placeholder="Optional claims JSON value, example:
{
&quot;acr&quot;: &quot;reference&quot;
}"
></textarea>
</div>
<button type="submit" class="btn btn-primary topBtn"><i class="fa fa-sign-in"></i>Sign-in</button>
</form>
</div>
</div>
</div>
</body>

</html>
42 changes: 42 additions & 0 deletions ui/sso-test/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0
#
# SPDX-License-Identifier: EPL-2.0
version: '3.7'
networks:
test:
name: ${DOCKER_NETWORK:-test}

services:
oauth:
image: ghcr.io/navikt/mock-oauth2-server:2.1.6
networks:
- test
ports:
- "9900:9900"
expose:
- "9900"
volumes:
- ./app/login.html:/app/login.html
environment:
PORT: 9900
LOG_LEVEL: DEBUG
JSON_CONFIG: |
{
"interactiveLogin": true,
"httpServer": "NettyWrapper",
"loginPagePath": "/app/login.html",
"staticAssetsPath": "/app/static",
"tokenCallbacks": [
{
"issuerId": "fake",
"tokenExpiry": 300
}
]
}

0 comments on commit 5601fc5

Please sign in to comment.