diff --git a/app.py b/app.py new file mode 100644 index 0000000..bf71915 --- /dev/null +++ b/app.py @@ -0,0 +1,26 @@ +from flask import Flask, render_template + +app = Flask(__name__) +app.config['SECRET_KEY'] = 'onelogindemopytoolkit' + +@app.route("/", methods=['GET', 'POST']) +def index(): + errors = [] + error_reason = None + not_auth_warn = False + success_slo = False + attributes = False + paint_logout = False + return render_template( + 'index.html', + errors=errors, + error_reason=error_reason, + not_auth_warn=not_auth_warn, + success_slo=success_slo, + attributes=attributes, + paint_logout=paint_logout + ) + + +if __name__ == "__main__": + app.run(host='127.0.0.1', port=5001, debug=True) diff --git a/example.url b/example.url new file mode 100644 index 0000000..be72e13 --- /dev/null +++ b/example.url @@ -0,0 +1 @@ +https://gist.github.com/thomasdarimont/6a3905778520b746ff009cf3a41643e9 diff --git a/requirements.txt b/requirements.txt index feed64f..adad3fd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -authlib \ No newline at end of file +authlib +flask \ No newline at end of file diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..0eb5518 --- /dev/null +++ b/templates/base.html @@ -0,0 +1,26 @@ + + + + + + + + A Python OIDC demo + + + + + + + + +
+

A Python OIDC demo

+ + {% block content %}{% endblock %} +
+ + \ No newline at end of file diff --git a/templates/index.html b/templates/index.html new file mode 100644 index 0000000..5eb54aa --- /dev/null +++ b/templates/index.html @@ -0,0 +1,54 @@ +{% extends "base.html" %} + +{% block content %} + +{% if errors %} + +{% endif %} + +{% if not_auth_warn %} + +{% endif %} + +{% if success_slo %} + +{% endif %} + +{% if paint_logout %} + {% if attributes %} +

You have the following attributes:

+ + + + + + {% for attr in attributes %} + + + {% endfor %} + +
NameValues
{{ attr.0 }}
    + {% for val in attr.1 %} +
  • {{ val }}
  • + {% endfor %} +
+ {% else %} + + {% endif %} + Logout +{% else %} + Login +{% endif %} +Metadata + +{% endblock %} \ No newline at end of file