Skip to main content
Glama
akramIOT

Zero Trust Access AI Agent - MCP Server

auth_oauth2.py658 B
from fastapi import Depends, HTTPException, status from fastapi.security import OAuth2PasswordBearer from jose import JWTError, jwt import os SECRET_KEY = os.getenv("OAUTH2_SECRET_KEY", "secret") ALGORITHM = "HS256" oauth2_scheme = OAuth2PasswordBearer(tokenUrl="/token") def verify_token(token: str = Depends(oauth2_scheme)): try: payload = jwt.decode(token, SECRET_KEY, algorithms=[ALGORITHM]) return payload except JWTError: raise HTTPException( status_code=status.HTTP_401_UNAUTHORIZED, detail="Invalid authentication credentials", headers={"WWW-Authenticate": "Bearer"}, )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/akramIOT/ZTA_MCP_Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server