pub struct SsoClient { /* private fields */ }Expand description
SSO 客户端 | SSO Client
每个应用作为 SSO 客户端,处理本地会话和票据验证 Each application acts as SSO Client, handling local sessions and ticket validation
Implementations§
Source§impl SsoClient
impl SsoClient
Sourcepub fn new(
manager: Arc<SaTokenManager>,
server_url: String,
service_url: String,
) -> Self
pub fn new( manager: Arc<SaTokenManager>, server_url: String, service_url: String, ) -> Self
创建新的 SSO 客户端 | Create a new SSO Client
§参数 | Parameters
manager- SaTokenManager 实例 | SaTokenManager instanceserver_url- SSO 服务端 URL | SSO Server URLservice_url- 当前服务 URL | Current service URL
pub fn with_logout_callback<F>(self, callback: F) -> Self
pub fn get_login_url(&self) -> String
pub fn get_logout_url(&self) -> String
pub async fn check_local_login(&self, login_id: &str) -> bool
pub async fn process_ticket( &self, ticket: &str, service: &str, ) -> SaTokenResult<String>
pub async fn login_by_ticket(&self, login_id: String) -> SaTokenResult<String>
pub async fn handle_logout(&self, login_id: &str) -> SaTokenResult<()>
pub fn server_url(&self) -> &str
pub fn service_url(&self) -> &str
Auto Trait Implementations§
impl Freeze for SsoClient
impl !RefUnwindSafe for SsoClient
impl Send for SsoClient
impl Sync for SsoClient
impl Unpin for SsoClient
impl !UnwindSafe for SsoClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more