oauth
| Kind | kit |
|---|---|
| Capabilities | net |
| Categories | authentication web |
| Keywords | oauth oauth2 authentication authorization security |
OAuth 2.0 client library for Kit
Files
| File | Description | |
|---|---|---|
.editorconfig | Editor formatting configuration | |
.gitignore | Git ignore rules for build artifacts and dependencies | |
.tool-versions | asdf tool versions (Zig, Kit) | |
LICENSE | MIT license file | |
README.md | This file | |
examples/client-credentials.kit | Example: client credentials | |
examples/github.kit | Example: github | |
kit.toml | Package manifest with metadata and dependencies | |
src/oauth.kit | Note: This module uses Kit's standard Result type (Ok a | Err String). |
tests/oauth.test.kit | Tests for oauth | |
tests/types.test.kit | Tests for types |
Architecture
Authorization Code Flow
sequenceDiagram
participant App
participant User
participant AuthServer
participant ResourceServer
App->>User: Redirect to Auth URL
User->>AuthServer: Login & Consent
AuthServer->>App: Authorization Code
App->>AuthServer: Exchange Code + Secret
AuthServer->>App: Access Token
App->>ResourceServer: API Request + Token
ResourceServer->>App: Protected Resource
Client Credentials Flow
sequenceDiagram
participant App
participant AuthServer
participant ResourceServer
App->>AuthServer: Client ID + Secret
AuthServer->>App: Access Token
App->>ResourceServer: API Request + Token
ResourceServer->>App: Protected Resource
Dependencies
base64
Installation
kit add gitlab.com/kit-lang/packages/kit-oauth.gitUsage
import Kit.OauthLicense
MIT License - see LICENSE for details.