-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathspring-boot-starter-auth-example.yml
More file actions
81 lines (73 loc) · 1.99 KB
/
spring-boot-starter-auth-example.yml
File metadata and controls
81 lines (73 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Exemple de configuration pour spring-boot-starter-auth
# Copiez ces propriétés dans votre fichier application.yml et personnalisez selon vos besoins
spring-boot-starter-auth:
# Configuration JWT
jwt:
secret: VotreClefSecrete404E635266556A586E3272357538782F413F4428472B4B6250645367566B5970
expiration: 86400000 # 24 heures en millisecondes
# Configuration OAuth2
oauth2:
enabled: true
success-url: /home
failure-url: /login?error=true
authorized-redirect-uris:
- http://localhost:8080/oauth2/redirect
- http://localhost:3000/oauth2/redirect
# Configuration Swagger
swagger:
title: API d'Authentification
description: API pour la gestion complète de l'authentification
version: 1.0
# Configuration nécessaire pour OAuth2 avec des fournisseurs externes
spring:
security:
oauth2:
client:
registration:
google:
client-id: ${GOOGLE_CLIENT_ID}
client-secret: ${GOOGLE_CLIENT_SECRET}
scope:
- email
- profile
github:
client-id: ${GITHUB_CLIENT_ID}
client-secret: ${GITHUB_CLIENT_SECRET}
scope:
- user:email
- read:user
# Configuration de la base de données
datasource:
url: jdbc:h2:mem:testdb
driverClassName: org.h2.Driver
username: sa
password: password
jpa:
database-platform: org.hibernate.dialect.H2Dialect
hibernate:
ddl-auto: update
# Configuration des emails
mail:
host: localhost
port: 1025
username: ${SMTP_USERNAME}
password: ${SMTP_PASSWORD}
properties:
mail:
smtp:
auth: true
starttls:
enable: true
# Configuration de l'application
app:
email:
from: noreply@yourdomain.com
base-url: http://localhost:8080
security:
max-failed-attempts: 3
lock-duration-hours: 24
# Configuration des logs
logging:
level:
com.enokdev: DEBUG
org.springframework.security: INFO