Skip to content

Commit 18bd35a

Browse files
authored
Merge pull request #102 from evelyndooley/develop
Update to flask-pyoidc version 2.0.0
2 parents c1c8b16 + ee7199c commit 18bd35a

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

packet/__init__.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from flask import Flask
1111
from flask_migrate import Migrate
1212
from flask_pyoidc.flask_pyoidc import OIDCAuthentication
13+
from flask_pyoidc.provider_configuration import ProviderConfiguration, ClientMetadata
1314
from flask_sqlalchemy import SQLAlchemy
1415

1516
app = Flask(__name__)
@@ -37,11 +38,11 @@
3738
migrate = Migrate(app, db)
3839
app.logger.info("SQLAlchemy pointed at " + repr(db.engine.url))
3940

40-
auth = OIDCAuthentication(app, issuer=app.config["OIDC_ISSUER"], client_registration_info={
41-
"client_id": app.config["OIDC_CLIENT_ID"],
42-
"client_secret": app.config["OIDC_CLIENT_SECRET"],
43-
"post_logout_redirect_uris": "/logout/"
44-
})
41+
APP_CONFIG = ProviderConfiguration(issuer=app.config["OIDC_ISSUER"],
42+
client_metadata=ClientMetadata(app.config["OIDC_CLIENT_ID"],
43+
app.config["OIDC_CLIENT_SECRET"]))
44+
45+
auth = OIDCAuthentication({'app': APP_CONFIG}, app)
4546

4647
# LDAP
4748
_ldap = csh_ldap.CSHLDAP(app.config["LDAP_BIND_DN"], app.config["LDAP_BIND_PASS"])

packet/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def packet_auth(func):
5656
"""
5757
Decorator for easily configuring oidc
5858
"""
59-
@auth.oidc_auth
59+
@auth.oidc_auth('app')
6060
@wraps(func)
6161
def wrapped_function(*args, **kwargs):
6262
if app.config["REALM"] == "csh":

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Flask==1.0.2
2-
Flask-pyoidc==1.3.0
2+
Flask-pyoidc==2.0.0
33
flask_sqlalchemy==2.3.2
44
psycopg2-binary==2.7.5
55
Flask-Migrate==2.2.1

0 commit comments

Comments
 (0)