corevpn-auth

Crates.iocorevpn-auth
lib.rscorevpn-auth
version0.1.0
created_at2026-01-02 17:16:05.218809+00
updated_at2026-01-02 17:16:05.218809+00
descriptionAuthentication and authorization for CoreVPN - OAuth2, OIDC, SAML support
homepagehttps://pegasusheavy.github.io/corevpn/
repositoryhttps://github.com/pegasusheavy/corevpn
max_upload_size
id2018912
size133,545
Joseph R. Quinn (quinnjr)

documentation

README

corevpn-auth

Crates.io Documentation License

Authentication and authorization for CoreVPN - OAuth2, OIDC, and SAML support.

Features

  • OAuth2/OIDC: Integration with identity providers
  • SAML 2.0: Enterprise SSO support
  • Certificate Auth: X.509 client certificate authentication
  • Token Management: Secure token storage and refresh
  • Provider Support: Google, Microsoft, Okta, and generic OIDC

Supported Providers

Provider Type Features
Google 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

Usage

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?;

License

Licensed under either of:

at your option.

Commit count: 0

cargo fmt