Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProxyIdP GUI
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Perun
Perun ProxyIdP
ProxyIdP GUI
Commits
df13ff07
Commit
df13ff07
authored
2 years ago
by
Johana Supíková
Browse files
Options
Downloads
Plain Diff
postlogout
parents
29cbba19
c7b9fede
No related branches found
No related tags found
No related merge requests found
Pipeline
#322814
failed
2 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
perun/proxygui/gui/gui.py
+26
-3
26 additions, 3 deletions
perun/proxygui/gui/gui.py
perun/proxygui/gui/templates/Logout.html
+1
-1
1 addition, 1 deletion
perun/proxygui/gui/templates/Logout.html
perun/proxygui/gui/templates/Post-logout.html
+14
-1
14 additions, 1 deletion
perun/proxygui/gui/templates/Post-logout.html
with
41 additions
and
5 deletions
perun/proxygui/gui/gui.py
+
26
−
3
View file @
df13ff07
...
...
@@ -110,9 +110,10 @@ def construct_gui_blueprint(cfg, auth):
"
from_devices
"
:
rp_sid
is
None
,
# user might have been logged out for all devices
"
labels
"
:
rp_names
.
get
(
client_id
,
client_id
),
"
client_id
"
:
client_id
,
}
if
client_id
is
not
None
else
None
else
{}
)
session_services
=
logout_manager
.
complete_service_names
(
...
...
@@ -122,6 +123,7 @@ def construct_gui_blueprint(cfg, auth):
device_active_clients
,
rp_names
)
session
[
"
logout_params
"
]
=
logout_params
if
logout_params
else
{}
session
[
"
init_logged_out_service
"
]
=
logged_out_service
resp
=
make_response
(
render_template
(
...
...
@@ -184,6 +186,9 @@ def construct_gui_blueprint(cfg, auth):
]
session
[
"
logout_requests
"
]
=
logout_requests
session
[
"
init_logged_out_service
"
][
"
logback_url
"
]
=
(
service_configs
.
get
(
"
RPS
"
,
{}).
get
(
client_id
,
{}).
get
(
"
logback_url
"
)
)
# todo - map current running instance to issuer by app domain?
sub_issuer
=
"
https://idp2.ics.muni.cz/idp/shibboleth
"
...
...
@@ -207,9 +212,11 @@ def construct_gui_blueprint(cfg, auth):
@gui.route
(
"
/post_logout
"
)
def
post_logout
():
logout_params
=
session
.
get
(
"
logout_params
"
)
if
logout_params
is
None
:
# can be empty but should exist
init_logged_out_service
=
session
.
get
(
"
init_logged_out_service
"
)
if
(
logout_params
is
None
or
init_logged_out_service
is
None
):
# can be {} but not None (wrong flow then)
return
render_template
(
"
MissingAuth.html
"
)
if
"
post_logout_redirect_uri
"
in
logout_params
:
...
...
@@ -219,9 +226,25 @@ def construct_gui_blueprint(cfg, auth):
url
=
f
"
{
url
}
?
{
state
}
"
if
"
?
"
not
in
url
else
f
"
{
url
}
&
{
state
}
"
return
redirect
(
url
)
# if "logback_url" not in init_logged_out_service:
# service_configs = logout_manager.fetch_services_configuration()
# client_id = init_logged_out_service["client_id"]
# session["init_logged_out_service"]["logback_url"] = service_configs
# .get("RPS", {}).get(client_id, {}).get(
# "logback_url")
# remove later alligator
init_logged_out_service
=
{
"
from_devices
"
:
False
,
"
labels
"
:
{
"
en
"
:
"
Rick Astley
'
s Youtube
"
,
"
cs
"
:
"
Rickův Youtube
"
},
"
client_id
"
:
"
ricks_awesome_youtube
"
,
"
logback_url
"
:
"
https://youtu.be/dQw4w9WgXcQ?si=ZdnRZv-ruOcqVfsg
"
,
}
# todo - retrieve 'log back in' URL from config and pass to template
return
render_template
(
"
Post-logout.html
"
,
init_logged_out_service
=
init_logged_out_service
,
bootstrap_color
=
COLOR
,
)
...
...
This diff is collapsed.
Click to expand it.
perun/proxygui/gui/templates/Logout.html
+
1
−
1
View file @
df13ff07
...
...
@@ -5,7 +5,7 @@
class=
"window {% if cfg.css_framework == 'MUNI' %}framework_muni{% else %}framework_bootstrap5 bg-light{% endif %}"
>
<div
class=
"wrap{% if not cfg.css_framework == 'MUNI' %} d-flex flex-column gap-2{% endif %}"
>
{% if logged_out_service
is not none
%}
{% if logged_out_service %}
{% if cfg.css_framework == 'MUNI' %}
<h2
class=
"margin-top-1em"
>
{{ _("Logout Successful") }}
</h2>
{% else %}
...
...
This diff is collapsed.
Click to expand it.
perun/proxygui/gui/templates/Post-logout.html
+
14
−
1
View file @
df13ff07
...
...
@@ -10,6 +10,19 @@
<h2
class=
"margin-left-24"
>
{{ _("Logout successful") }}
</h2>
</div>
</div>
<br>
{% if init_logged_out_service.logback_url is not none %}
<div
class=
"my-flex-column"
>
<div
style=
"text-align: start"
>
<h4>
{{ _("Would you like to log back to") }} {{ init_logged_out_service.labels.get(lang) }}?
</h4>
<p
class=
"{% if cfg.css_framework == 'MUNI' %}btn-wrap{% else %}d-flex flex-row gap-3 ms-3{% endif %}"
>
<a
href=
"{{ init_logged_out_service.logback_url }}"
class=
"btn btn-primary btn-s"
>
<span
class=
"no-uppercase"
>
{{ _('Log back') }}
</span>
</a>
</p>
<br>
</div>
</div>
{% endif %}
</div>
{% endblock %}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment