Skip to content
Snippets Groups Projects
Commit 89c3a4b5 authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

Feat-fix flask app user variables

1. Set username to REMOTE_USER
2. Set fullname to Displayname
parent deeedab0
No related branches found
No related tags found
No related merge requests found
...@@ -47,13 +47,8 @@ def create_app(config_name): ...@@ -47,13 +47,8 @@ def create_app(config_name):
def get_authorized_user(): def get_authorized_user():
user = { user = {
"username": re.search( "username": request.headers.get("REMOTE_USER"),
r"([^!]+?)(@uab\.edu)?$", request.headers.get("Persistent-Id") "fullname": request.headers.get("Displayname"),
).group(1),
"fullname": (
f"{request.headers.get('Givenname')}"
f" {request.headers.get('Sn')}"
),
"email": request.headers.get("Mail"), "email": request.headers.get("Mail"),
"eppa": request.headers.get("Unscoped-Affiliation"), "eppa": request.headers.get("Unscoped-Affiliation"),
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment