Skip to content
Snippets Groups Projects
Commit 47e89871 authored by Mart van Santen's avatar Mart van Santen
Browse files

Removed old panels and update gitlab ci to stop building those

parent 89c1aa2c
No related branches found
No related tags found
2 merge requests!68Merge loginpanel into main and release 0.5.0,!56Resolve "Remove old panel from code"
Pipeline #9714 failed
<!doctype html>
<title>Stackspin authentication service</title>
<div style='margin: 0 auto ; width: 350px; padding:20px; border-style:solid; border-color:#6c757d; border-width: 1px; background-color: #f8f9fa; font-family: "Segoe UI", Roboto; font-family: "Helvetica Neue", Arial; font-family: "Noto Sans", sans-serif;'>
{% if logo %}
<div style="position:relative; width: 350px; height:100px">
<img style="overflow: auto; top: 0; left: 0; bottom: 0; right: 0; position: absolute; margin: auto;max-width: 300px; max-height: 100px" src="{{logo}}" alt="Logo of application"></img>
</div>
{% endif %}
<h1>Log in to {{ application_name }}</h1>
<div style="width: 100%; margin-bottom: 5px; overflow: auto">
<div style="width:60%; float:left"><button id="continue" onclick="window.location.href = '/login?login_challenge={{ challenge }}&skip=true';">Continue with {{ username }}</button></div>
<div style="width:40%; float:left;"><button id="logout" onclick="window.location.href = '/login?login_challenge={{ challenge }}&logout=true';">Logout</button></div>
</div>
</div>
FROM python:3.9-alpine
RUN apk add gcc libc-dev libffi-dev
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
ARG FLASK_PORT=5002
EXPOSE $FLASK_PORT
ENV FLASK_ENV production
ENV FLASK_RUN_PORT $FLASK_PORT
ENV FLASK_RUN_HOST 0.0.0.0
ENV HYDRA_ADMIN_URL http://localhost:4445
CMD [ "flask", "run" ]
from flask import abort, Flask, redirect, request
from flask.views import View
from hydra_client import HydraAdmin
import hydra_client
import logging
from os import environ
HYDRA_ADMIN_URL = environ['HYDRA_ADMIN_URL']
HYDRA = HydraAdmin(HYDRA_ADMIN_URL)
app = Flask(__name__)
app.logger.setLevel(logging.INFO)
@app.route('/logout', methods=['GET'])
def home():
"""Handles the OpenID Connect Logout flow
Communicates with the hydra server to start the logout flow which uses backchannel and
frontchannel logout methods to log out the user from all applications they have
access to.
Args:
logout_challenge: Reference to a logout challenge object in form of an alphanumeric
String. Can be used to retrieve the LogoutRequest object via the Hydra Admin API (GET)
Returns:
Redirect to the url that is provided by the LogoutRequest object.
"""
challenge = request.args.get("logout_challenge")
app.logger.info("Logout request: challenge={0}".format(challenge))
if not challenge:
abort(403)
try:
logout_request = HYDRA.logout_request(challenge)
except hydra_client.exceptions.NotFound:
app.logger.error("Not Found. Logout request not found. challenge={0}".format(challenge))
abort(404)
except hydra_client.exceptions.HTTPError:
app.logger.error("Conflict. Logout request has been used already. challenge={0}".format(challenge))
abort(503)
return redirect(logout_request.accept(subject=logout_request.subject))
if __name__ == '__main__':
app.run()
Flask
hydra-client
Subproject commit 9a16055973a2b36acf361e853eb55b4cfbd0c6f4
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment