mcpField
B
bkend-auth

bkend-auth

github.com/ww-w-aiSecurity60644 installsUpdated 4w ago
Repository

About bkend-auth

A bkend.ai authentication and security reference covering login methods, token handling, access policies, and sessions. It explains how to use MCP documentation search to guide implementation of REST-based authentication.

Key features

  1. 01Email, social, and magic-link login
  2. 02JWT access and refresh tokens
  3. 03Password reset and account operations
  4. 04RBAC and row-level security
  5. 05Per-device session management

Use cases

  1. 01Implementing signup and login flows
  2. 02Adding social or magic-link authentication
  3. 03Applying role and row-level access policies
  4. 04Reviewing and revoking user sessions

MCP support

bkend MCP has no dedicated authentication tools. The guide uses search_docs to find authentication instructions and examples, which can inform generated REST API code.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/ww-w-ai/bkit-claude-code --skill bkend-auth

After installing, type/bkend-authin Claude Code to confirm it loaded.

Details

From the project README

bkend.ai Authentication & Security Guide

Auth Methods

MethodDescription
Email + PasswordEmail/password signup and login
Social (Google)OAuth 2.0 social login
Social (GitHub)OAuth 2.0 social login
Magic LinkEmail link login (no password)

JWT Token Structure

  • Access Token: 1 hour validity
  • Refresh Token: 7 days validity
  • Auto-refresh: POST /v1/auth/refresh

Password Policy

8+ characters, uppercase + lowercase + numbers + special characters

MCP Auth Workflow

bkend MCP does NOT have dedicated auth tools. Use this workflow:

  1. Search docs: search_docs with query "email signup" or "social login"
  2. Get examples: search_docs with query "auth code examples"
  3. Generate code: AI generates REST API code based on search results
Searchable Auth Docs
Doc IDContent
3_howto_implement_authSignup, login, token management guide
6_code_examples_authEmail, social, magic link code examples
Key Pattern
User: "Add social login"
  → search_docs(query: "social login implementation")
  → Returns auth guide with REST API patterns
  → AI generates social login code

REST Auth API (Core Endpoints)

For the complete endpoint list, use search_docs or check Live Reference.

MethodEndpointDescription
POST/v1/auth/email/signupSign up
POST/v1/auth/email/signinSign in
GET/v1/auth/meCurrent user
POST/v1/auth/refreshRefresh token
POST/v1/auth/signoutSign out
GET/POST/v1/auth/:provider/callbackSocial login callback
POST/v1/auth/password/reset/requestPassword reset
POST/v1/auth/password/reset/confirmConfirm reset
POST/v1/auth/password/changeChange password
GET/v1/auth/sessionsList sessions
DELETE/v1/auth/sessions/:sessionIdRemove session
DELETE/v1/auth/withdrawDelete account

Additional endpoints (MFA, invitations, user management): use search_docs or Live Reference.

RBAC (Role-Based Access Control)

GroupDescriptionScope
adminFull CRUDAll data
userAuthenticated userFull read, own write
selfOwner onlycreatedBy-based
guestUnauthenticatedRead only (usually)

RLS (Row Level Security)

  • Per-table row-level access control
  • 4-level policies: admin/user/self/guest
  • Auto-filtering based on createdBy field

Session Management

  • Per-device session tracking
  • GET /v1/auth/sessions - List sessions
  • DELETE /v1/auth/sessions/:sessionId - Remove session

Official Documentation (Live Reference)

For the latest authentication documentation, use WebFetch:

Comments

Markdown supported