| Crates.io | corevpn-auth |
| lib.rs | corevpn-auth |
| version | 0.1.0 |
| created_at | 2026-01-02 17:16:05.218809+00 |
| updated_at | 2026-01-02 17:16:05.218809+00 |
| description | Authentication and authorization for CoreVPN - OAuth2, OIDC, SAML support |
| homepage | https://pegasusheavy.github.io/corevpn/ |
| repository | https://github.com/pegasusheavy/corevpn |
| max_upload_size | |
| id | 2018912 |
| size | 133,545 |
Authentication and authorization for CoreVPN - OAuth2, OIDC, and SAML support.
| Provider | Type | Features |
|---|---|---|
| OIDC | Domain restriction, group claims | |
| Microsoft | OIDC | Azure AD, tenant restriction |
| Okta | OIDC | Group-based access control |
| Generic | OIDC | Any OIDC-compliant IdP |
| SAML | SAML 2.0 | Enterprise IdP integration |
use corevpn_auth::{OAuthProvider, OAuthConfig};
// Configure Google OAuth
let config = OAuthConfig::google(
"client_id",
"client_secret",
vec!["example.com".to_string()], // allowed domains
);
// Create provider
let provider = OAuthProvider::new(config).await?;
// Get authorization URL
let (auth_url, state) = provider.authorization_url()?;
// Exchange code for tokens
let tokens = provider.exchange_code(code, state).await?;
Licensed under either of:
at your option.