Skip to main content

authentik_client/models/
o_auth2_provider_request.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2026.2.0
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// OAuth2ProviderRequest : OAuth2Provider Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OAuth2ProviderRequest {
17    #[serde(rename = "name")]
18    pub name: String,
19    /// Flow used for authentication when the associated application is accessed by an un-authenticated user.
20    #[serde(
21        rename = "authentication_flow",
22        default,
23        with = "::serde_with::rust::double_option",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub authentication_flow: Option<Option<uuid::Uuid>>,
27    /// Flow used when authorizing this provider.
28    #[serde(rename = "authorization_flow")]
29    pub authorization_flow: uuid::Uuid,
30    /// Flow used ending the session from a provider.
31    #[serde(rename = "invalidation_flow")]
32    pub invalidation_flow: uuid::Uuid,
33    #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")]
34    pub property_mappings: Option<Vec<uuid::Uuid>>,
35    /// Confidential clients are capable of maintaining the confidentiality of their credentials. Public clients are incapable
36    #[serde(rename = "client_type", skip_serializing_if = "Option::is_none")]
37    pub client_type: Option<models::ClientTypeEnum>,
38    #[serde(rename = "client_id", skip_serializing_if = "Option::is_none")]
39    pub client_id: Option<String>,
40    #[serde(rename = "client_secret", skip_serializing_if = "Option::is_none")]
41    pub client_secret: Option<String>,
42    /// Access codes not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
43    #[serde(rename = "access_code_validity", skip_serializing_if = "Option::is_none")]
44    pub access_code_validity: Option<String>,
45    /// Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
46    #[serde(rename = "access_token_validity", skip_serializing_if = "Option::is_none")]
47    pub access_token_validity: Option<String>,
48    /// Tokens not valid on or after current time + this value (Format: hours=1;minutes=2;seconds=3).
49    #[serde(rename = "refresh_token_validity", skip_serializing_if = "Option::is_none")]
50    pub refresh_token_validity: Option<String>,
51    /// When refreshing a token, if the refresh token is valid for less than this duration, it will be renewed. When set to seconds=0, token will always be renewed. (Format: hours=1;minutes=2;seconds=3).
52    #[serde(rename = "refresh_token_threshold", skip_serializing_if = "Option::is_none")]
53    pub refresh_token_threshold: Option<String>,
54    /// Include User claims from scopes in the id_token, for applications that don't access the userinfo endpoint.
55    #[serde(rename = "include_claims_in_id_token", skip_serializing_if = "Option::is_none")]
56    pub include_claims_in_id_token: Option<bool>,
57    /// Key used to sign the tokens.
58    #[serde(
59        rename = "signing_key",
60        default,
61        with = "::serde_with::rust::double_option",
62        skip_serializing_if = "Option::is_none"
63    )]
64    pub signing_key: Option<Option<uuid::Uuid>>,
65    /// Key used to encrypt the tokens. When set, tokens will be encrypted and returned as JWEs.
66    #[serde(
67        rename = "encryption_key",
68        default,
69        with = "::serde_with::rust::double_option",
70        skip_serializing_if = "Option::is_none"
71    )]
72    pub encryption_key: Option<Option<uuid::Uuid>>,
73    #[serde(rename = "redirect_uris")]
74    pub redirect_uris: Vec<models::RedirectUriRequest>,
75    #[serde(rename = "logout_uri", skip_serializing_if = "Option::is_none")]
76    pub logout_uri: Option<String>,
77    /// Backchannel logs out with server to server calls. Frontchannel uses iframes in your browser
78    #[serde(rename = "logout_method", skip_serializing_if = "Option::is_none")]
79    pub logout_method: Option<models::OAuth2ProviderLogoutMethodEnum>,
80    /// Configure what data should be used as unique User Identifier. For most cases, the default should be fine.
81    #[serde(rename = "sub_mode", skip_serializing_if = "Option::is_none")]
82    pub sub_mode: Option<models::SubModeEnum>,
83    /// Configure how the issuer field of the ID Token should be filled.
84    #[serde(rename = "issuer_mode", skip_serializing_if = "Option::is_none")]
85    pub issuer_mode: Option<models::IssuerModeEnum>,
86    #[serde(rename = "jwt_federation_sources", skip_serializing_if = "Option::is_none")]
87    pub jwt_federation_sources: Option<Vec<uuid::Uuid>>,
88    #[serde(rename = "jwt_federation_providers", skip_serializing_if = "Option::is_none")]
89    pub jwt_federation_providers: Option<Vec<i32>>,
90}
91
92impl OAuth2ProviderRequest {
93    /// OAuth2Provider Serializer
94    pub fn new(
95        name: String,
96        authorization_flow: uuid::Uuid,
97        invalidation_flow: uuid::Uuid,
98        redirect_uris: Vec<models::RedirectUriRequest>,
99    ) -> OAuth2ProviderRequest {
100        OAuth2ProviderRequest {
101            name,
102            authentication_flow: None,
103            authorization_flow,
104            invalidation_flow,
105            property_mappings: None,
106            client_type: None,
107            client_id: None,
108            client_secret: None,
109            access_code_validity: None,
110            access_token_validity: None,
111            refresh_token_validity: None,
112            refresh_token_threshold: None,
113            include_claims_in_id_token: None,
114            signing_key: None,
115            encryption_key: None,
116            redirect_uris,
117            logout_uri: None,
118            logout_method: None,
119            sub_mode: None,
120            issuer_mode: None,
121            jwt_federation_sources: None,
122            jwt_federation_providers: None,
123        }
124    }
125}