oauth
| Kind | kit |
|---|---|
| Categories | authentication web |
| Keywords | oauth oauth2 authentication authorization security |
OAuth 2.0 client library for Kit
Files
| File | Description |
|---|---|
kit.toml | Package manifest with metadata and dependencies |
src/oauth.kit | OAuth flows, provider presets, and token management |
tests/oauth.test.kit | Tests for providers, URLs, state, and expiration |
examples/client-credentials.kit | Machine-to-machine auth without user interaction |
examples/github.kit | Authorization code flow with GitHub API |
LICENSE | MIT license file |
Architecture
Authorization Code Flow
Client Credentials Flow
Dependencies
base64
Installation
kit add gitlab.com/kit-lang/packages/kit-oauth.gitUsage
import Kit.OauthLicense
MIT License - see LICENSE for details.
Exported Functions & Types
authorize-url
OAuthConfig -> String -> String
authorize-url-pkce
OAuthConfig -> String -> String -> String
exchange-code
OAuthConfig -> String -> Result TokenResponse String
exchange-code-pkce
OAuthConfig -> String -> String -> Result TokenResponse String
refresh-token
OAuthConfig -> String -> Result TokenResponse String
client-credentials
OAuthConfig -> Result TokenResponse String
get
String -> String -> Result HttpResponse String
post
String -> String -> String -> Result HttpResponse String
github
String -> String -> String -> List String -> OAuthConfig
google
String -> String -> String -> List String -> OAuthConfig
microsoft
String -> String -> String -> String -> List String -> OAuthConfig
discord
String -> String -> String -> List String -> OAuthConfig
slack
String -> String -> String -> List String -> OAuthConfig
gitlab
String -> String -> String -> List String -> OAuthConfig
custom
String -> String -> String -> String -> String -> List String -> OAuthConfig
generate-state
String
is-expired?
TokenResponse -> Int -> Bool