Doesnt work but may be getting somewhere.
parent
62a54b0cd0
commit
688be51a2e
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "Python: Current File (Integrated Terminal)",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${file}",
|
||||
"console": "integratedTerminal"
|
||||
},
|
||||
{
|
||||
"name": "Python: Attach",
|
||||
"type": "python",
|
||||
"request": "attach",
|
||||
"port": 5678,
|
||||
"host": "localhost"
|
||||
},
|
||||
{
|
||||
"name": "Python: Module",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"module": "enter-your-module-name-here",
|
||||
"console": "integratedTerminal"
|
||||
},
|
||||
{
|
||||
"name": "Python: Django",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/manage.py",
|
||||
"console": "integratedTerminal",
|
||||
"args": [
|
||||
"runserver",
|
||||
"--noreload",
|
||||
"--nothreading"
|
||||
],
|
||||
"django": true
|
||||
},
|
||||
{
|
||||
"name": "Python: Flask",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"module": "flask",
|
||||
"env": {
|
||||
"FLASK_APP": "claims.py"
|
||||
},
|
||||
"args": [
|
||||
"run",
|
||||
"--no-debugger",
|
||||
"--no-reload"
|
||||
],
|
||||
"jinja": true
|
||||
},
|
||||
{
|
||||
"name": "Python: Current File (External Terminal)",
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${file}",
|
||||
"console": "externalTerminal"
|
||||
}
|
||||
]
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
@echo off
|
||||
set FLASK_ENV=development
|
||||
set FLASK_APP=src/claims.py
|
||||
flask run
|
||||
python %FLASK_APP%
|
|
@ -1,6 +1,8 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import flask
|
||||
import json
|
||||
from flask import jsonify
|
||||
from flask import request
|
||||
from flask import render_template
|
||||
|
||||
|
@ -17,20 +19,18 @@ def hello_world():
|
|||
return "Hello world!"
|
||||
|
||||
|
||||
@app.route('/claims/saml/', methods=['POST', 'GET'])
|
||||
def get_saml_claims(foo):
|
||||
@app.route('/claims/saml', methods=['POST', 'GET'])
|
||||
def get_saml_claims():
|
||||
error = None
|
||||
if request.method == 'POST':
|
||||
r = request
|
||||
pass
|
||||
return json.dumps(request.get_data(), sort_keys=True)
|
||||
if request.method == 'GET':
|
||||
#
|
||||
pass
|
||||
return render_template('claims.html', error=error)
|
||||
return "Dude where's my claims?"
|
||||
|
||||
|
||||
|
||||
@app.route('/claims/oauth/', methods=['POST', 'GET'])
|
||||
def get_oauth_claims(foo):
|
||||
def get_oauth_claims():
|
||||
error = None
|
||||
if request.method == 'POST':
|
||||
# handle claims token
|
||||
|
@ -39,3 +39,7 @@ def get_oauth_claims(foo):
|
|||
#
|
||||
pass
|
||||
return render_template('claims.html', error=error)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(ssl_context='adhoc')
|
Loading…
Reference in New Issue