AINative Auth Guide for Openclaw

A comprehensive guide and toolset for implementing robust authentication methods including API keys, JWT sessions, and OAuth2 social logins within AINative environments.

urbantech
v1.0.0
Mar 24, 2026
0
848
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install ainative-auth-guide

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install ainative-auth-guide using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is AINative Auth Guide?

The AINative Auth Guide is a specialized resource within the Openclaw Skills ecosystem designed to streamline the implementation of secure access patterns. It provides developers with the necessary patterns to choose between server-side API key authentication and client-side Bearer JWT tokens. By standardizing how agents and applications interact with AINative APIs, it ensures high security without sacrificing developer velocity.

This skill covers the full identity lifecycle, from user registration and email verification to advanced social login callbacks for LinkedIn and GitHub. Whether you are building a standalone MCP tool or a complex web application, using these Openclaw Skills patterns ensures your authentication logic remains consistent and production-ready.

AINative Auth Guide Use Cases

  • Implementing secure server-to-server communication using persistent API keys.
  • Building user-facing web applications with secure JWT session management and token refreshing.
  • Integrating social login providers like GitHub and LinkedIn to simplify user onboarding.
  • Protecting Next.js routes and API endpoints using standardized middleware patterns.
  • Managing password recovery workflows and user profile retrieval.

How AINative Auth Guide Works

  1. Method Selection: The developer identifies the use case (e.g., a background agent vs. a browser-based user) to choose between API Key, JWT, or OAuth2.
  2. Credential Acquisition: Keys are generated via CLI tools or account registration endpoints.
  3. Request Interception: The skill provides header structures (e.g., X-API-Key or Authorization Bearer) to be included in outbound API calls.
  4. Session Lifecycle: For JWT flows, the skill manages the exchange of login credentials for access and refresh tokens.
  5. Validation & Refresh: Middleware or client-side logic monitors token expiration and automatically hits the refresh endpoint to maintain session persistence.

AINative Auth Guide Setup

To begin using these authentication patterns within your Openclaw Skills environment, initialize your credentials:

# Initialize your environment and retrieve your primary API key
npx zerodb init

For Next.js projects, install the SDK and configure your middleware:

npm install @ainative/next-sdk

AINative Auth Guide Data Schema & Taxonomy

The authentication skill utilizes specific header formats and JSON structures for identity management:

Attribute Type Description
X-API-Key Header Used for server-side or agent authentication (format: ak_...)
Authorization Header Used for user sessions (format: Bearer <token>)
access_token String Short-lived JWT for API access
refresh_token String Long-lived token used to generate new access tokens

All auth-related endpoints follow the versioned prefix /api/v1/auth/.

AINative Auth Guide Advanced Features

  • Multi-Provider OAuth: Ready-to-use callback patterns for LinkedIn and GitHub social integration.
  • Automated Middleware: Pre-configured Next.js middleware to handle path protection and redirection with minimal code.
  • Agent-Ready Auth: Optimized for Openclaw Skills agents requiring non-interactive, long-term API access via secure keys.
  • Session Revocation: Centralized logout endpoints to invalidate JWT sessions across all devices.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*