mirror of
https://github.com/yuezk/GlobalProtect-openconnect.git
synced 2025-05-20 07:26:58 -04:00
feat: gpauth support macos
This commit is contained in:
@@ -1,13 +1,23 @@
|
||||
mod authenticator;
|
||||
pub use authenticator::auth_prelogin;
|
||||
pub use authenticator::Authenticator;
|
||||
use anyhow::bail;
|
||||
use gpapi::{
|
||||
gp_params::GpParams,
|
||||
portal::{prelogin, Prelogin},
|
||||
};
|
||||
|
||||
#[cfg(feature = "browser-auth")]
|
||||
mod browser_auth;
|
||||
mod browser;
|
||||
|
||||
#[cfg(feature = "browser-auth")]
|
||||
pub use browser_auth::BrowserAuthenticator;
|
||||
pub use browser::*;
|
||||
|
||||
#[cfg(feature = "webview-auth")]
|
||||
mod webview_auth;
|
||||
mod webview;
|
||||
#[cfg(feature = "webview-auth")]
|
||||
pub use webview_auth::WebviewAuthenticator;
|
||||
pub use webview::*;
|
||||
|
||||
pub async fn auth_prelogin(server: &str, gp_params: &GpParams) -> anyhow::Result<String> {
|
||||
match prelogin(server, gp_params).await? {
|
||||
Prelogin::Saml(prelogin) => Ok(prelogin.saml_request().to_string()),
|
||||
Prelogin::Standard(_) => bail!("Received non-SAML prelogin response"),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user