little string refactor
This commit is contained in:
parent
282628427b
commit
9013f8ce8d
5
app.py
5
app.py
@ -1,4 +1,3 @@
|
|||||||
import json
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from flask import Flask, request, redirect, session, make_response, render_template
|
from flask import Flask, request, redirect, session, make_response, render_template
|
||||||
@ -7,7 +6,7 @@ from onelogin.saml2.utils import OneLogin_Saml2_Utils
|
|||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
app.config['SAML_PATH'] = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config')
|
app.config['SAML_PATH'] = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'config')
|
||||||
app.config['SECRET_KEY'] = 'onelogindemopytoolkit'
|
app.config['SECRET_KEY'] = 'onelogindemopy'
|
||||||
|
|
||||||
def init_saml_auth(req):
|
def init_saml_auth(req):
|
||||||
auth = OneLogin_Saml2_Auth(req, custom_base_path=app.config['SAML_PATH'])
|
auth = OneLogin_Saml2_Auth(req, custom_base_path=app.config['SAML_PATH'])
|
||||||
@ -129,4 +128,4 @@ def metadata():
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
app.run(debug=True)
|
app.run(host='127.0.0.1', port=5000, debug=True)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
|
||||||
<title>A Python SAML Toolkit demo</title>
|
<title>A Python SAML demo</title>
|
||||||
|
|
||||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
||||||
|
|
||||||
@ -18,7 +18,7 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>A Python SAML Toolkit demo</h1>
|
<h1>A Python SAML demo</h1>
|
||||||
|
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user