Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1363 implement singlesignon via comunity aai #1896

Draft
wants to merge 68 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
46881bd
basic setup for django allauth #1895
jh-RLI Oct 23, 2024
a2c30a6
add django allauth to project urls #1895
jh-RLI Oct 23, 2024
2a081a6
add template settings for django allauth social login using openid_co…
jh-RLI Oct 23, 2024
e4ccf51
add django allauth to requirements #1895
jh-RLI Oct 23, 2024
67cc72d
attempt to fix ci error: set the email field in settings #1895
jh-RLI Oct 23, 2024
0ca5bfe
change order if installed apps to check if failing CI is affected
jh-RLI Nov 11, 2024
1ac018b
enhance login template (WIP)
jh-RLI Nov 14, 2024
200cc74
Merge branch 'develop' into 1363-implement-singlesignon-via-comunity-aai
jh-RLI Nov 19, 2024
c81fac5
populate profile test
Nov 19, 2024
a92afe6
Merge branch '1363-implement-singlesignon-via-comunity-aai' of https:…
jh-RLI Nov 19, 2024
e653555
Merge branch 'develop' into 1363-implement-singlesignon-via-comunity-aai
jh-RLI Nov 19, 2024
c2dfd28
extend django allauth settings template
jh-RLI Nov 19, 2024
0eae775
Merge branch '1363-implement-singlesignon-via-comunity-aai' of https:…
Nov 19, 2024
6194224
add view to populate user name in case of social login
jh-RLI Nov 19, 2024
1345570
rename login template dir to account to match the default name django…
jh-RLI Nov 20, 2024
6e8043f
add new nav bar template to base app
jh-RLI Nov 20, 2024
da3d3fc
include new navbar template #1895
jh-RLI Nov 20, 2024
2bd7ccf
add app.urls namespace & add new route for user redirect & adapt new…
jh-RLI Nov 20, 2024
64f2356
add view for user redirect #1895
jh-RLI Nov 20, 2024
073112f
fix new urls namespace for login url paths #1895
jh-RLI Nov 20, 2024
ab12f3d
add django allauth settings and migrate form django auth system #1895
jh-RLI Nov 20, 2024
e77a965
add adapter to handle django allauth user creation for regular and so…
jh-RLI Nov 20, 2024
4d1b155
update user create form base class to djangoallauths SignupForm class…
jh-RLI Nov 20, 2024
13d30f4
fore django allauth migrations to wait for the login migrations to ta…
jh-RLI Nov 20, 2024
33d8dc7
add basic documentation for login app #1895 #1363
jh-RLI Nov 20, 2024
ee4f036
rename adapter module #1363
jh-RLI Nov 20, 2024
442bc85
enhance navbar login / logout 1363
jh-RLI Nov 20, 2024
9de1ccd
add base for login widget content #1895
jh-RLI Nov 20, 2024
e676a8c
add login and logout templates to override allauth default templates …
jh-RLI Nov 20, 2024
41a2429
fix heading
jh-RLI Nov 20, 2024
b912038
fix new app namespace in url calls #1363
jh-RLI Nov 20, 2024
3ac09d1
use adapter instead #1895
jh-RLI Nov 20, 2024
392a959
add allauth settings to setup login adapters #1895
jh-RLI Nov 20, 2024
4704394
implement context processor form django cookie cutter template projec…
jh-RLI Nov 20, 2024
2348f25
enhance login template #1895
jh-RLI Nov 21, 2024
6d32183
add placeholder
jh-RLI Nov 21, 2024
9df94b2
Merge branch '1363-implement-singlesignon-via-comunity-aai' of https:…
Nov 27, 2024
9686a42
remove deprecated user field #1363
jh-RLI Nov 27, 2024
ac3913c
adapt login forms to django allauth #1895
jh-RLI Nov 27, 2024
1fd331e
remove deprecated middleware functionality #1363
jh-RLI Nov 27, 2024
6f5e4bb
remove custom password authentication #1363
jh-RLI Nov 27, 2024
1a0b1b1
remove custom password authentication views #1363 to use django allau…
jh-RLI Nov 27, 2024
59eb336
remove deprecated paths #1363
jh-RLI Nov 27, 2024
7b9a371
add basic template to extend django allauth signup template #1895
jh-RLI Nov 27, 2024
7d20e29
add various django allauth templates and remove custom login middlewa…
jh-RLI Nov 27, 2024
2bd35b3
Merge branch '1363-implement-singlesignon-via-comunity-aai' of https:…
Nov 27, 2024
9546158
Added some basic missing templates for sociallogin workflow
Nov 27, 2024
0f6c0a3
Added more needed templates without changing them for now
Nov 27, 2024
b223f26
Changed the parent class of the added templates to "account/base.html…
Nov 27, 2024
f32e612
fix populate user hook implementation #1895
jh-RLI Dec 4, 2024
a48b22d
update security settings template #1895
jh-RLI Dec 4, 2024
67c2d3e
update documentation #1363
jh-RLI Dec 4, 2024
6c580ea
add basic docstrings #1895
jh-RLI Dec 5, 2024
e754166
enhance login setup & code module documentation #1895 #1363
jh-RLI Dec 5, 2024
1fe8d68
remove section that is now part of the settings.py
jh-RLI Dec 5, 2024
f94dec3
add new login documentation page to the doc #1363
jh-RLI Dec 5, 2024
a82b2ed
make linter happy
jh-RLI Dec 5, 2024
5e82d32
add password change template
jh-RLI Dec 18, 2024
7aed1d3
add provider list template
jh-RLI Dec 18, 2024
bc47f4a
enhance layout of login template
jh-RLI Dec 18, 2024
8e8d0a9
add password set template
jh-RLI Dec 18, 2024
5155295
adapt user settings template to use django allauth password reset fun…
jh-RLI Dec 18, 2024
4d9d634
add providerlist login snippet template
jh-RLI Dec 18, 2024
4ee1a90
add setting to log users out once they changed their password #1363
jh-RLI Jan 22, 2025
9b207d4
add template to provide shared common style for django messages showi…
jh-RLI Jan 22, 2025
f6076ac
add missing password reset templates #1363 #1895
jh-RLI Jan 22, 2025
510fc39
adding messages framework #1363
jh-RLI Jan 22, 2025
db3cc3f
deactivate deprecated url #1363
jh-RLI Jan 22, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions api/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@ def setUpClass(cls):
cls.token = Token.objects.get(user=cls.user)

cls.other_user, _ = myuser.objects.get_or_create(
name="NotMrTest",
email="[email protected]",
did_agree=True,
is_mail_verified=True,
name="NotMrTest", email="[email protected]", did_agree=True
)
cls.other_user.save()
cls.other_token = Token.objects.get(user=cls.other_user)
Expand Down
84 changes: 2 additions & 82 deletions base/templates/base/base-full.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,91 +28,11 @@

<body class="d-flex flex-column h-100">
{% block header %}
<nav class="navbar navbar-expand-lg navbar-dark bg-secondary">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="/">
<img style="width:45px;height: 45px;" src="{% static 'OpenEnergyFamily_Logo_OpenEnergyPlatform_untitled_white.svg' %}"/>
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/dataedit/schemas">Database</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownFS" role="button"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Scenario Bundles
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownFS">
<!-- <a class="dropdown-item" href="/factsheets/overview/">Overview</a> -->
<!-- <sup class="small text-muted">Early Access</sup> -->
<a class="dropdown-item" href="/scenario-bundles/main">Scenario Bundle</a>
<a class="dropdown-item" href="/factsheets/frameworks/">Framework Factsheet</a>
<a class="dropdown-item" href="/factsheets/models/">Model Factsheet</a>
<!-- <a class="dropdown-item" href="/factsheets/scenarios/">Scenario Factsheet</a> -->
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownOntology" role="button"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Ontology
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownOntology">
<a class="dropdown-item" href="/ontology/">Overview</a>
<a class="dropdown-item" href="/ontology/oeo/BFO_0000001/">OEO Classes</a>
<a class="dropdown-item" href="/viewer/oeo/">OEO Viewer</a>
<a class="dropdown-item" href="{% url 'oeo-s-c'%}">OEO Steering Committee</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.tib_terminology_service }}" target="_blank" data-toggle="tooltip" data-placement="top" title="We want to combine our efforts in ontology development with the TIB as part of the NFDI4Energy project."><i class="fas fa-external-link-alt"></i> TIB Terminology Service</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ EXTERNAL_URLS.tutorials_index }}" target="_blank">Academy <i class="fas fa-external-link-alt"></i></a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownAbout" role="button"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
About
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownAbout">
<a class="dropdown-item" href="/about/">Overview</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.compendium }}" target="_blank"><i class="fas fa-external-link-alt"></i> Compendium</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.mkdocs }}" target="_blank"><i class="fas fa-external-link-alt"></i> Developer Documentation</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.readthedocs }}" target="_blank"><i class="fas fa-external-link-alt"></i> REST-API Documentation</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.tutorials_faq }}" target="_blank"><i class="fas fa-external-link-alt"></i> FAQ</a>
</div>
</li>
</ul>
</div>
{% if user.is_authenticated %} {# This should stay here - later the above if becomes obsolete #}

<div class="d-flex align-items-center gap-3">
<!-- Profile Link -->
<a class="btn btn-link text-white p-0" href="/user/profile/{{ user.pk }}/settings">
{% fa5_icon 'user' 'fas' %} {{ user }}
</a>

<!-- Logout Form -->
<form method="post" action="{% url 'logout' %}" class="m-0">
{% csrf_token %}
<input type="hidden" name="next" value="/">
<button type="submit" class="btn btn-danger btn-sm">
{% fa5_icon 'arrow-right' 'fas' %} Logout
</button>
</form>
</div>

{% else %}
<a class="btn btn-info" style="float: right;margin:5px"
href="/user/login/?next={{ request.get_full_path|urlencode }}">{% fa5_icon 'log-in' 'fas' %} Login</a>
{% endif %}

</div>
</nav>
{% include "base/navbar.html" %}

{% endblock header %}

{% block main %}
<main class="main">
{% block site-header %}
Expand Down
83 changes: 1 addition & 82 deletions base/templates/base/base-profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,89 +28,8 @@

<body class="d-flex flex-column h-100">
{% block header %}
<nav class="navbar navbar-expand-lg navbar-dark bg-secondary">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="/">
<img style="width:45px;height: 45px;" src="{% static 'OpenEnergyFamily_Logo_OpenEnergyPlatform_untitled_white.svg' %}"/>
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/dataedit/schemas">Database</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownFS" role="button"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Scenario Bundles
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownFS">
<!-- <a class="dropdown-item" href="/factsheets/overview/">Overview</a> -->
<a class="dropdown-item" href="/scenario-bundles/main">Scenario Bundle</a>
<a class="dropdown-item" href="/factsheets/frameworks/">Framework Factsheet</a>
<a class="dropdown-item" href="/factsheets/models/">Model Factsheet</a>

<!-- <a class="dropdown-item" href="/factsheets/scenarios/">Scenario Factsheet</a> -->
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownOntology" role="button"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Ontology
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownOntology">
<a class="dropdown-item" href="/ontology/">Overview</a>
<a class="dropdown-item" href="/ontology/oeo/BFO_0000001/">OEO Classes</a>
<a class="dropdown-item" href="/viewer/oeo/">OEO Viewer</a>
<a class="dropdown-item" href="{% url 'oeo-s-c'%}">OEO Steering Committee</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.tib_terminology_service }}" target="_blank" data-toggle="tooltip" data-placement="top" title="We want to combine our efforts in ontology development with the TIB as part of the NFDI4Energy project."><i class="fas fa-external-link-alt"></i> TIB Terminology Service</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ EXTERNAL_URLS.tutorials_index }}" target="_blank">Academy <i class="fas fa-external-link-alt"></i></a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownAbout" role="button"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
About
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownAbout">
<a class="dropdown-item" href="/about/">Overview</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.compendium }}" target="_blank"><i class="fas fa-external-link-alt"></i> Compendium</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.mkdocs }}" target="_blank"><i class="fas fa-external-link-alt"></i> Developer Documentation</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.readthedocs }}" target="_blank"><i class="fas fa-external-link-alt"></i> REST-API Documentation</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.tutorials_faq }}" target="_blank"><i class="fas fa-external-link-alt"></i> FAQ</a>
</div>
</li>
</ul>
</div>
{% if user.is_authenticated %} {# This should stay here - later the above if becomes obsolete #}

<div class="d-flex align-items-center gap-3">
<!-- Profile Link -->
<a class="btn btn-link text-white p-0" href="/user/profile/{{ user.pk }}/settings">
{% fa5_icon 'user' 'fas' %} {{ user }}
</a>

<!-- Logout Form -->
<form method="post" action="{% url 'logout' %}" class="m-0">
{% csrf_token %}
<input type="hidden" name="next" value="/">
<button type="submit" class="btn btn-danger btn-sm">
{% fa5_icon 'arrow-right' 'fas' %} Logout
</button>
</form>
</div>

{% else %}
<a class="btn btn-info" style="float: right;margin:5px"
href="/user/login/?next={{ request.get_full_path|urlencode }}">{% fa5_icon 'log-in' 'fas' %} Login</a>
{% endif %}

</div>
</nav>
{% include "base/navbar.html" %}

{% endblock header %}
{% block main %}
Expand Down
82 changes: 1 addition & 81 deletions base/templates/base/base-sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,88 +42,8 @@

<body class="d-flex flex-column h-100">
{% block header %}
<nav class="navbar navbar-expand-lg navbar-dark bg-secondary">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="/">
<img style="width:45px;height: 45px;" src="{% static 'OpenEnergyFamily_Logo_OpenEnergyPlatform_untitled_white.svg' %}"/>
</a>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="/dataedit/schemas">Database</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownFS" role="button"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Scenario Bundles
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownFS">
<!-- <a class="dropdown-item" href="/factsheets/overview/">Overview</a> -->
<a class="dropdown-item" href="/scenario-bundles/main">Scenario Bundle</a>
<a class="dropdown-item" href="/factsheets/frameworks/">Framework Factsheet</a>
<a class="dropdown-item" href="/factsheets/models/">Model Factsheet</a>
<!-- <a class="dropdown-item" href="/factsheets/scenarios/">Scenario Factsheet</a> -->
</div>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownOntology" role="button"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Ontology
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownOntology">
<a class="dropdown-item" href="/ontology/">Overview</a>
<a class="dropdown-item" href="/ontology/oeo/BFO_0000001/">OEO Classes</a>
<a class="dropdown-item" href="/viewer/oeo/">OEO Viewer</a>
<a class="dropdown-item" href="{% url 'oeo-s-c'%}">OEO Steering Committee</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.tib_terminology_service }}" target="_blank" data-toggle="tooltip" data-placement="top" title="We want to combine our efforts in ontology development with the TIB as part of the NFDI4Energy project."><i class="fas fa-external-link-alt"></i> TIB Terminology Service</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ EXTERNAL_URLS.tutorials_index }}" target="_blank">Academy <i class="fas fa-external-link-alt"></i></a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdownAbout" role="button"
data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
About
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdownAbout">
<a class="dropdown-item" href="/about/">Overview</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.compendium }}" target="_blank"><i class="fas fa-external-link-alt"></i> Compendium</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.mkdocs }}" target="_blank"><i class="fas fa-external-link-alt"></i> Developer Documentation</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.readthedocs }}" target="_blank"><i class="fas fa-external-link-alt"></i> REST-API Documentation</a>
<a class="dropdown-item" href="{{ EXTERNAL_URLS.tutorials_faq }}" target="_blank"><i class="fas fa-external-link-alt"></i> FAQ</a>
</div>
</li>
</ul>
</div>
{% if user.is_authenticated %} {# This should stay here - later the above if becomes obsolete #}

<div class="d-flex align-items-center gap-3">
<!-- Profile Link -->
<a class="btn btn-link text-white p-0" href="/user/profile/{{ user.pk }}/settings">
{% fa5_icon 'user' 'fas' %} {{ user }}
</a>

<!-- Logout Form -->
<form method="post" action="{% url 'logout' %}" class="m-0">
{% csrf_token %}
<input type="hidden" name="next" value="/">
<button type="submit" class="btn btn-danger btn-sm">
{% fa5_icon 'arrow-right' 'fas' %} Logout
</button>
</form>
</div>

{% else %}
<a class="btn btn-info" style="float: right;margin:5px"
href="/user/login/?next={{ request.get_full_path|urlencode }}">{% fa5_icon 'log-in' 'fas' %} Login</a>
{% endif %}

</div>
</nav>
{% include "base/navbar.html" %}

{% endblock header %}
{% block main %}
Expand Down
Loading