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.apiclient.dto;
23
24 /** Classe image de la requête OIDC envoyée par le framework WEB OIDC. */
25 public record RequeteCreationTokenOidcDto(String code, String codeVerifier, String redirectUri, String grantType, String refreshToken) {
26
27 /**
28 * Constructeur utilisable dans le cas d'une création de token OIDC à partir des informations échangées entre l'application et la page de
29 * connexion du fournisseur d'identité OIDC
30 */
31 public RequeteCreationTokenOidcDto(String code, String codeVerifier, String redirectUri, String grantType) {
32 this(code, codeVerifier, redirectUri, grantType, null);
33 }
34
35 /** Constructeur utilisable dans le cas d'un refresh de token OIDC à partir du seul refreshToken (le grantType="refresh_token"). */
36 public RequeteCreationTokenOidcDto(String grantType, String refreshToken) {
37 this(null, null, null, grantType, refreshToken);
38 }
39
40 }