Skip to main content

zlayer_types/api/
oidc.rs

1//! OIDC / SSO API DTOs.
2
3use serde::{Deserialize, Serialize};
4
5use crate::api::auth::UserView;
6
7/// Query params on the callback URL — the provider appends `?code=...&state=...`
8/// on success, or `?error=...&error_description=...` on user denial.
9#[derive(Debug, Deserialize)]
10pub struct CallbackParams {
11    #[serde(default)]
12    pub code: Option<String>,
13    #[serde(default)]
14    pub state: Option<String>,
15    #[serde(default)]
16    pub error: Option<String>,
17    #[serde(default)]
18    pub error_description: Option<String>,
19}
20
21/// Callback response body (returned as JSON unless the operator prefers a
22/// redirect; initial integration keeps JSON so the Manager UI can show a
23/// welcome screen post-exchange).
24#[derive(Debug, Serialize, Deserialize, utoipa::ToSchema)]
25pub struct OidcCallbackResponse {
26    pub user: UserView,
27    pub csrf_token: String,
28    pub provider: String,
29}