Skip to content

Commit

Permalink
accounts: Remove keycloak activation compatibility
Browse files Browse the repository at this point in the history
We don't need to redirect to the activation page anymore.
Nobody uses the register url this way anymore

We don't need the import users script anymore.

Just keep the password hash update.
  • Loading branch information
tonial committed Oct 13, 2024
1 parent cf1e061 commit b31424f
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 279 deletions.
3 changes: 1 addition & 2 deletions docs/inclusion_connect.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,7 @@ L'_id token_ est un objet JWT signé qui contient notamment :
- **email** : son adresse e-mail.


La signature du token est chiffrée avec l'algorithme `RS256` et il est possible de récupérer la clé publique sur une API
de keycloak pour vérifier la signature.
La signature du token est chiffrée avec l'algorithme `RS256` et il est possible de récupérer la clé publique pour vérifier la signature.

Cependant, dans le cas où l'_access token_ est récupéré via un appel direct du _backend_ au _OpendID Connect provider_ (Inclusion Connect)
et non par exemple récupéré par le _frontend_ puis transmis au _backend_, la validation du token ne protège pas grand-chose.
Expand Down
6 changes: 0 additions & 6 deletions inclusion_connect/accounts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@ class RegisterView(BaseUserCreationView):
template_name = "register.html"
EVENT_NAME = "register"

# TODO: Remove keycloak compatibility
def dispatch(self, request, *args, **kwargs):
if all(param in oidc_params(request) for param in ["login_hint", "lastname", "firstname"]):
return HttpResponseRedirect(reverse("accounts:activate"))
return super().dispatch(request, *args, **kwargs)


class ActivateAccountView(BaseUserCreationView):
form_class = forms.ActivateAccountForm
Expand Down
5 changes: 0 additions & 5 deletions inclusion_connect/middleware.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import logging

from django.core.exceptions import PermissionDenied
from django.urls import reverse
from django.utils.cache import add_never_cache_headers
Expand All @@ -8,9 +6,6 @@
from inclusion_connect.utils.urls import add_url_params


logger = logging.getLogger("keycloak_compat")


def never_cache(get_response):
def middleware(request):
response = get_response(request)
Expand Down
266 changes: 0 additions & 266 deletions scripts/import_from_kc_one_user.py

This file was deleted.

0 comments on commit b31424f

Please sign in to comment.