Date : 14/01/2026 00:40 Durée : ~1h30 Statut : TERMINE
Création d'un service centralisé pour gérer les connexions aux services externes (LinkedIn, Gmail, Twitter, etc.) avec OAuth et browser automation.
Service déployé sur prod-portainer pour gérer les OAuth des services externes.
Stack :
Fichiers :
/stock_8to/33800-stack/docker/stacks/connectors-api/
├── src/
│ ├── index.ts # API principale
│ ├── connectors/
│ │ └── linkedin.ts # Connecteur LinkedIn OAuth
│ └── store/
│ └── tokens.ts # Gestion tokens Redis
├── package.json
├── Dockerfile
└── docker-compose.yml
Endpoints :
| Endpoint | Méthode | Description |
|---|---|---|
| /health | GET | Health check |
| /api/status | GET | Status tous connecteurs |
| /api/linkedin/auth | GET | URL d'autorisation OAuth |
| /api/linkedin/callback | GET | Callback OAuth |
| /api/linkedin/status | GET | Status connexion |
| /api/linkedin/profile | GET | Profil utilisateur |
| /api/linkedin/post | POST | Publier un post |
| /api/linkedin/disconnect | POST | Déconnexion |
App : 33800-automation Developer Portal : https://www.linkedin.com/developers/
Credentials stockés dans prod.env :
Redirect URL :
https://connectors.33800.nowhere84.com/api/linkedin/callback
Scopes obtenus :
Fichier : /etc/nginx/sites-available/connectors.conf
URL : https://connectors.33800.nowhere84.com
Profil récupéré :
LinkedIn API très restrictive :
| Fonctionnalité | Via API | Via Browser |
|---|---|---|
| Profil basique | ✅ | ✅ |
| Poster | ✅ | ✅ |
| Connexions | ❌ | ✅ |
| Messages | ❌ | ✅ |
| Profil complet | ❌ | ✅ |
Service avec Chrome headless pour accéder aux fonctionnalités bloquées par les APIs.
Credentials personnels stockés :
Architecture prévue :
┌─────────────────────────────────────────────┐
│ BROWSER CONNECTOR (5401) │
├─────────────────────────────────────────────┤
│ Chrome/Playwright headless │
│ └── LinkedIn : profile, connections, DMs │
│ └── Gmail : inbox, send, contacts │
│ └── Twitter : DMs, timeline │
│ │
│ Sessions stockées dans Redis │
└─────────────────────────────────────────────┘
| Service | URL |
|---|---|
| API interne | http://192.168.1.12:5400 |
| API externe | https://connectors.33800.nowhere84.com |
| Swagger | https://connectors.33800.nowhere84.com/swagger |
# Status LinkedIn
curl https://connectors.33800.nowhere84.com/api/linkedin/status
# Profil
curl https://connectors.33800.nowhere84.com/api/linkedin/profile
# Poster sur LinkedIn
curl -X POST https://connectors.33800.nowhere84.com/api/linkedin/post \
-H "Content-Type: application/json" \
-d '{"text": "Mon premier post via API!"}'
# Logs container
ssh gouroubleu@192.168.1.12 "docker logs connectors-api"
# Restart
ssh gouroubleu@192.168.1.12 "docker restart connectors-api"