smithery/valec3

backend-security-authentication

JWT, session management, password hashing.

Installation

$ npx skills add smithery/valec3 --skill backend-security-authentication

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/valec3 · top by installs.

npx skills add smithery/valec3

Browse all from smithery/valec3

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,300 B
  • docs SUMMARY.md 81 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

Backend Security Authentication

When to use this skill

  • User login/registration
  • API authentication
  • Session management
  • Password security

Workflow

  • Hash passwords properly
  • Generate secure tokens
  • Validate credentials
  • Implement logout
  • Refresh tokens

Instructions

Password Hashing

<?php

// Hash
$hash = password_hash($password, PASSWORD_DEFAULT);

// Verify
if (password_verify($inputPassword, $user->password)) {
    // Correct
}

JWT Authentication

<?php

use Firebase\JWT\JWT;

class AuthService
{
    public function generateToken(User $user): string
    {
        $payload = [
            'iss' => 'myapp',
            'sub' => $user->id,
            'iat' => time(),
            'exp' => time() + 3600
        ];

        return JWT::encode($payload, env('JWT_SECRET'), 'HS256');
    }

    public function validateToken(string $token): ?object
    {
        try {
            return JWT::decode($token, new Key(env('JWT_SECRET'), 'HS256'));
        } catch (\Exception $e) {
            return null;
        }
    }
}

Resources

  • Never store plain passwords
  • Use strong JWT secrets
  • Implement token refresh