六 5、CSRF 配置 - ZeroOrInfinity/UMS GitHub Wiki

所属模块: core 模块

简单配置: 不对 csrf 进行任何配置, 默认关闭 csrf 功能.

详细配置: demo 模块 -> basic-detail-example

ums:
  client:
    csrf:
      # csrf 是否开启, 默认为 false;
      csrf-is-open: false
      # 忽略指定请求的 CSRF 防护, 默认为 空 Set
      ignoring-ant-matcher-urls:
        - /authentication/form
        - /authentication/mobile
        - /authentication/social
        - /user/**
        - /file/**
      # csrf tokenRepository 的存储类型, 默认为 session. 因为 session 可以配置缓存在 redis 等, 也可以自己自定义, 例如: redis
      token-repository-type: session