Comrade
Comrade - A Crystal OAuth library inspired by Laravel Socialite
Comrade provides a simple, elegant interface for OAuth authentication with various providers like GitHub, Google, Facebook, and more.
Example: github = Comrade.driver(Provider::Github) auth_url = github.redirect(scopes: ["user:email"]) user = github.user(callback_code)
Constants
Class methods
Configure global settings
Example: Comrade.configure { |config| config.http_timeout = 30 }
Main manager for accessing OAuth providers
Returns a provider instance for the given driver
Examples: github = Comrade.driver(Provider::Github) google = Comrade.driver(:google) # Symbol automatically converts to Provider::Google
Check if a provider is configured
Examples: Comrade.provider_configured?(Provider::Github) Comrade.provider_configured?(:google) # Symbol automatically converts
Register a provider configuration from environment variables
Examples: Comrade.register_provider(Provider::Github, "GITHUB_CLIENT_ID", "GITHUB_CLIENT_SECRET") Comrade.register_provider(:google, "GOOGLE_CLIENT_ID") # Symbol automatically converts
Nested types
- Comrade::AuthorizationException
- Comrade::ConfigurationException
- Comrade::Exception
- Comrade::Http
- Comrade::HttpException
- Comrade::InvalidScopeException
- Comrade::InvalidStateException
- Comrade::InvalidTokenException
- Comrade::Manager
- Comrade::NotSupportedException
- Comrade::Provider
- Comrade::ProviderConfig
- Comrade::Providers
- Comrade::Token
- Comrade::User