42 lines
1.3 KiB
Markdown
42 lines
1.3 KiB
Markdown
![]() |
# Configuration OAuth2 OpenStreetMap
|
||
|
|
||
|
## Variables d'environnement requises
|
||
|
|
||
|
Pour utiliser l'authentification OSM, vous devez configurer les variables suivantes :
|
||
|
|
||
|
### Frontend (environments/environment.ts)
|
||
|
```typescript
|
||
|
export const environment = {
|
||
|
production: false,
|
||
|
osmClientId: 'your_osm_client_id_here',
|
||
|
osmClientSecret: 'your_osm_client_secret_here', // Ne pas utiliser côté client
|
||
|
apiBaseUrl: 'http://localhost:5000'
|
||
|
};
|
||
|
```
|
||
|
|
||
|
### Backend (.env)
|
||
|
```bash
|
||
|
OSM_CLIENT_ID=your_osm_client_id_here
|
||
|
OSM_CLIENT_SECRET=your_osm_client_secret_here
|
||
|
API_BASE_URL=http://localhost:5000
|
||
|
```
|
||
|
|
||
|
## Configuration OSM
|
||
|
|
||
|
1. Allez sur https://www.openstreetmap.org/user/your_username/oauth_clients
|
||
|
2. Créez une nouvelle application OAuth
|
||
|
3. Configurez l'URL de redirection : `http://localhost:4200/oauth/callback`
|
||
|
4. Copiez le Client ID et Client Secret
|
||
|
|
||
|
## Fonctionnalités
|
||
|
|
||
|
- Connexion/déconnexion OSM
|
||
|
- Persistance des données utilisateur en localStorage
|
||
|
- Ajout automatique du pseudo OSM dans `last_modified_by` pour les nouveaux événements
|
||
|
- Interface utilisateur pour gérer l'authentification
|
||
|
|
||
|
## Sécurité
|
||
|
|
||
|
⚠️ **Important** : Le Client Secret ne doit jamais être exposé côté client.
|
||
|
L'échange du code d'autorisation contre un token d'accès doit se faire côté serveur.
|