1 /*
2 This file is part of the talbotgui/psl project.
3 Authors: talbotgui.
4
5 This program is offered under a commercial and under the AGPL license.
6 For commercial licensing, contact me at talbotgui@gmail.com.
7 For AGPL licensing, see below.
8
9 AGPL licensing:
10 This program is free software: you can redistribute it and/or modify
11 it under the terms of the GNU Affero General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
14
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU Affero General Public License for more details.
19
20 AGPL license is available in LICENSE.md file and https://www.gnu.org/licenses/#AGPL
21 */
22 package com.github.talbotgui.psl.socle.securite.service;
23
24 import com.github.talbotgui.psl.socle.commun.oidc.dto.ReponseTokenOIDC;
25 import com.github.talbotgui.psl.socle.securite.apiclient.dto.ReponseJwtDto;
26 import com.github.talbotgui.psl.socle.securite.apiclient.dto.RequeteCreationTokenOidcDto;
27 import com.github.talbotgui.psl.socle.securite.client.dto.InformationSpUsagerDto;
28
29 public interface OidcService {
30
31 /**
32 * Chargement des données de l'usager et du compte (2 requêtes) à partir d'un token PSL.
33 *
34 * @param tokenPSL TokenPSL.
35 * @return Les données de l'usager et du compte dans un même DTO.
36 */
37 InformationSpUsagerDto chargerDonneesUsagerEtCompteAvecUnTokenPsl(String tokenPSL);
38
39 /**
40 * Création d'un nouveau token OIDC depuis le fournisseur.
41 *
42 * @param requeteDeclarationOIDC Données nécessaires à la création d'un token auprès du fournisseur OIDC.
43 * @return Nouveau token venant du fournisseur OIDC.
44 */
45 ReponseTokenOIDC creerOuRaffrachirLeToken(RequeteCreationTokenOidcDto requeteDeclarationOIDC);
46
47 /**
48 * Création d'un token PSL à partir d'un nom d'utilisateur et d'un mot de passe.
49 *
50 * @param nomUtilisateur Nom de l'utilisateur.
51 * @param motDePasse Mot de passe.
52 * @return Token PSL
53 */
54 ReponseJwtDto sauthentifierAvecUnNomDutilisateurEtUnMotDePasse(String nomUtilisateur, String motDePasse);
55
56 /**
57 * Création d'un token PSL anonyme
58 *
59 * @return
60 */
61 ReponseJwtDto sauthentifierEnAnonyme();
62 }