You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-12-11 13:03:11 +03:00
Legacy login via m.login.sso
This commit is contained in:
@@ -20,6 +20,7 @@ use rand::{
|
||||
};
|
||||
use serde::Serialize;
|
||||
use thiserror::Error;
|
||||
use url::Url;
|
||||
|
||||
use crate::{StorageBackend, StorageBackendMarker, User};
|
||||
|
||||
@@ -114,3 +115,29 @@ impl<S: StorageBackendMarker> From<CompatAccessToken<S>> for CompatAccessToken<(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||
#[serde(bound = "T: StorageBackend")]
|
||||
pub enum CompatSsoLoginState<T: StorageBackend> {
|
||||
Pending,
|
||||
Fullfilled {
|
||||
fullfilled_at: DateTime<Utc>,
|
||||
session: CompatSession<T>,
|
||||
},
|
||||
Exchanged {
|
||||
fullfilled_at: DateTime<Utc>,
|
||||
exchanged_at: DateTime<Utc>,
|
||||
session: CompatSession<T>,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||
#[serde(bound = "T: StorageBackend")]
|
||||
pub struct CompatSsoLogin<T: StorageBackend> {
|
||||
#[serde(skip_serializing)]
|
||||
pub data: T::CompatSsoLoginData,
|
||||
pub redirect_uri: Url,
|
||||
pub token: String,
|
||||
pub created_at: DateTime<Utc>,
|
||||
pub state: CompatSsoLoginState<T>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user