Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 5225ab3

Browse files
committed
Make configuration file specification a command argument.
1 parent 92816fc commit 5225ab3

2 files changed

Lines changed: 25 additions & 9 deletions

File tree

flask_rp/bc_conf.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PORT = 8090
2-
BASEURL = "https://localhost:{}".format(PORT)
2+
BASEURL = "https://127.0.0.1:{}".format(PORT)
33

44
# If BASE is https these has to be specified
55
SERVER_CERT = "certs/cert.pem"
@@ -61,7 +61,7 @@
6161
# support dynamic discovery and registration.
6262
"": CLIENT_CONFIG,
6363
"filip": {
64-
'issuer':"https://guarded-cliffs-8635.herokuapp.com/",
64+
'issuer': "https://guarded-cliffs-8635.herokuapp.com/",
6565
"redirect_uris": ["{}/authz_cb/filip".format(BASEURL)],
6666
"post_logout_redirect_uris": ["{}/session_logout".format(BASEURL)],
6767
"client_preferences": DEFAULT_CLIENT_PREFS,
@@ -70,7 +70,7 @@
7070
"backchannel_logout_uri": "{}/bc_logout".format(BASEURL)
7171
},
7272
"flop": {
73-
'issuer':"https://127.0.0.1:5000/",
73+
'issuer': "https://127.0.0.1:5000/",
7474
"redirect_uris": ["{}/authz_cb/flop".format(BASEURL)],
7575
"post_logout_redirect_uris": ["{}/session_logout".format(BASEURL)],
7676
"client_preferences": DEFAULT_CLIENT_PREFS,
@@ -86,6 +86,21 @@
8686
"services": DEFAULT_SERVICES,
8787
# "backchannel_logout_session_required": True,
8888
"backchannel_logout_uri": "{}/bc_logout".format(BASEURL)
89+
},
90+
'bobcat': {
91+
'issuer': 'https://127.0.0.1:8443/',
92+
"client_id": "client3",
93+
"client_secret": "2222222222222222222222222222222222222222",
94+
"redirect_uris": ["{}/authz_cb/bobcat".format(BASEURL)],
95+
"client_preferences": {
96+
"response_types": ["code"],
97+
"scope": ["openid", "offline_access"],
98+
"token_endpoint_auth_method": "client_secret_basic"
99+
},
100+
"services": {
101+
'ProviderInfoDiscovery': {}, 'Authorization': {}, 'AccessToken': {},
102+
'RefreshAccessToken': {}
103+
}
89104
}
90105
}
91106

flask_rp/wsgi.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import logging
22
import os
3+
import sys
34

45
try:
56
from . import application
@@ -18,13 +19,13 @@
1819

1920
dir_path = os.path.dirname(os.path.realpath(__file__))
2021

21-
template_dir = os.path.join(dir_path, 'templates')
22-
23-
name = 'oidc_rp'
24-
app = application.oidc_provider_init_app('fc_conf.py', name, template_folder=template_dir)
25-
logging.basicConfig(level=logging.DEBUG)
26-
2722
if __name__ == "__main__":
23+
conf = sys.argv[1]
24+
name = 'oidc_rp'
25+
template_dir = os.path.join(dir_path, 'templates')
26+
app = application.oidc_provider_init_app(conf, name,
27+
template_folder=template_dir)
28+
2829
app.run(host='127.0.0.1', port=app.config.get('PORT'),
2930
debug=True,
3031
ssl_context=('{}/certs/cert.pem'.format(dir_path),

0 commit comments

Comments
 (0)