web:framework:spring:jwt

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
web:framework:spring:jwt [2025/03/14 08:19] – [Services] jcheronweb:framework:spring:jwt [2025/08/12 02:35] (Version actuelle) – modification externe 127.0.0.1
Ligne 7: Ligne 7:
             <artifactId>spring-boot-starter-security</artifactId>             <artifactId>spring-boot-starter-security</artifactId>
         </dependency>         </dependency>
 +
 +        <dependency>
 +            <groupId>org.springframework.boot</groupId>
 +            <artifactId>spring-boot-starter-oauth2-resource-server</artifactId>
 +        </dependency>        
 </sxh> </sxh>
  
Ligne 100: Ligne 105:
         val source = UrlBasedCorsConfigurationSource()         val source = UrlBasedCorsConfigurationSource()
         val config = CorsConfiguration()         val config = CorsConfiguration()
-        if (activeProfile == "dev") { +        config.allowedOrigins = allowedOrigins.split(","
-            config.allowedOrigins = allowedOrigins.split(","+        config.allowedMethods = listOf("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH", "HEAD"
-            config.allowedMethods = listOf("GET", "POST", "PUT", "DELETE", "OPTIONS", "PATCH", "HEAD"+        config.allowedHeaders = listOf("*"
-            config.allowedHeaders = listOf("*"+        config.allowCredentials = true 
-            config.allowCredentials = true +        source.registerCorsConfiguration("/api/**", config)
-            source.registerCorsConfiguration("/api/**", config) +
-        }+
         return source         return source
     }     }
Ligne 118: Ligne 121:
 </sxh> </sxh>
  
 +===== RSA config =====
 +<sxh kotlin>
 +@ConfigurationProperties(prefix = "rsa")
 +@JvmRecord
 +data class RsaKeyConfigProperties(val publicKey: RSAPublicKey, val privateKey: RSAPrivateKey)
 +</sxh>
  
 +
 +==== Génération des clés RSA ====
 +Avec git bash :
 +<sxh bash;gutter:false>
 +genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:2048
 +</sxh>
 +
 +<sxh bash;gutter:false>
 +openssl rsa -in private.pem -pubout -out public.pem
 +</sxh>
 ==== AuthUser ==== ==== AuthUser ====
 <sxh kotlin> <sxh kotlin>
  • web/framework/spring/jwt.1741936745.txt.gz
  • Dernière modification : il y a 8 semaines
  • (modification externe)