-
Notifications
You must be signed in to change notification settings - Fork 103
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
[FIX][AUTH] Fix Public Access with CAS INPN and other bugs #3360
[FIX][AUTH] Fix Public Access with CAS INPN and other bugs #3360
Conversation
a8b95d9
to
757c928
Compare
Nice ! Tu as trouvé la source du problème de l'accès public ? |
82aa6b6
to
204b9fe
Compare
Oui, à l'aide de breakpoints j'ai fini par voir que ce problème - que tu as relevé dans #3353 - était dû à l'appel de
manageUser - GeoNature/frontend/src/app/components/auth/auth.service.ts Lines 61 to 73 in 8fae727
.toPromise() . La ligne suivante, qui s'occupe du chargement des routes des modules et de la redirection après authentification, n'était, par suite, pas exécutée. Toutefois, l'exécution de manageUser aboutissant bien par ailleurs, l'utilisateur était en fait bien logged in, et un second chargement permettait donc d'aboutir correctement à GeoNature en étant authentifié en public.
Il y avait quand même, par ailleurs, beaucoup d'autres anomalies avec l'authentification, comme tu peux le voir sur cette PR, du moins en 2.14.2, et je vais m'occuper de mettre les correctifs nécessaires, dont celui sur |
J'ai pris juste la partie de l'accès public, dépoyée en hotfix sur l'instance en question. Et c'est niquel ! |
Several fixes: - Fix direct public access with query param when INPN CAS authentification is configured - Fix flaky login and logout - ref #3353 - Use AuthGuard rather than UserCasGuard on NavHomeComponent, and remove UserCasGuard definition - Handle the case where a user is no more authentified server-side but still authentified client-side, by calling frontend logout() Chore: - Remove unused Router and AuthService from ModuleService constructor
Fix login and logout for Firefox clients. The library Moment.js is, if not deprecated, at least outdated and not fully functional on every client. For more information, see: https://momentjs.com/docs/#/-project-status/ The current commit replace use of Moment.js with Luxon in `auth.service.ts` to ensure correct functioning of functions: - `isLoggedIn()` - `isLoggedOut()` - `getExpiration()`
Previous implementation of logout(), with routing to login page after asynchronous request to backend /auth/logout endpoint, would not work on every client. Also, while still functional on Chrome clients, the previous implementation was weird as one would get redirected to the login page while possibly not yet fully logged out. This new implementation executes routing to login page after backend logout is done.
204b9fe
to
b4dddd0
Compare
Several fixes:
Chore: