auth-token-manager

Obtain JWT Bearer tokens for the MikoPBX REST API v3 via curl.

569|85|Updated Jun 7, 2019
One-click install
npx skills add https://github.com/mikopbx/Core --skill auth-token-manager
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: auth-token-manager
Source: https://github.com/mikopbx/Core/tree/main/.claude/skills/auth-token-manager
Command: npx skills add https://github.com/mikopbx/Core --skill auth-token-manager

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires curl, python3, and includes scripts (resource) components.

What problem does it solve?

This Skill automates obtaining valid JWT Bearer tokens for the MikoPBX REST API v3, reducing manual token requests and minimizing 401 errors during API testing and development.

Core Features & Use Cases

  • Automatic token acquisition: Retrieve access tokens via username/password with support for HTTPS endpoints.
  • Session management: Uses cookie-based refresh tokens and token rotation to maintain seamless authentication.
  • Scripting-friendly: Outputs the token to stdout for easy chaining in shell scripts and tests.

Quick Start

TOKEN=$(bash .claude/skills/auth-token-manager/get-auth-token.sh) curl -H "Authorization: Bearer $TOKEN" http://mikopbx-php83.localhost:8081/pbxcore/api/v3/extensions

Frequently Asked Questions about auth-token-manager

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I retrieve JWT tokens for MikoPBX REST API authentication?

JWT tokens for MikoPBX REST API v3 are retrieved by posting credentials to the /auth:login endpoint using curl. This Skill automates that request, stores refresh tokens, and outputs the accessToken to stdout for use in Bearer authentication headers across your API calls.

Can I use curl and bash to automate token retrieval for API testing?

Yes. This Skill uses curl and bash to automate JWT token acquisition, eliminating manual token requests during API testing and development. It reads credentials from environment variables and outputs tokens directly for chaining in shell scripts.

What credentials and environment setup do I need to get started with JWT authentication?

Set three environment variables: MIKOPBX_API_URL (your API endpoint), MIKOPBX_LOGIN (username), and MIKOPBX_PASSWORD (password). The Skill then handles the token exchange via curl and returns a Bearer token for authenticated REST API requests.

How does session management work with refresh tokens in API authentication?

This Skill uses cookie-based refresh tokens and token rotation to maintain seamless authentication sessions. Refresh tokens are stored in a cookie jar, enabling continuous access without re-authentication during API testing workflows.

Can I use this with HTTPS endpoints that have certificate issues?

Yes. The Skill includes an --insecure option to handle self-signed or untrusted HTTPS certificates, useful for development environments where standard certificate validation would block API access.

What exit codes indicate success or failure when retrieving tokens?

The Skill provides clear exit codes on success (token retrieved and output to stdout) or failure (invalid credentials, unreachable endpoint, or API errors), allowing shell scripts to branch on authentication outcomes.