当前位置: 首页 > news >正文

网站开发开题报告引言xampp 搭建wordpress

网站开发开题报告引言,xampp 搭建wordpress,张家港专业做网站,湖北建设招标网 官方网站在上一篇文章中#xff0c;我们基于Spring Security发出请求的默认表架构实现了安全性。 考虑到用户和角色#xff0c;应用程序开发人员使用适合其需求的架构。 Spring使我们能够指定所需的查询#xff0c;以便检索用户名#xff0c;密码和角色等信息。 我们的自定义表将… 在上一篇文章中我们基于Spring Security发出请求的默认表架构实现了安全性。 考虑到用户和角色应用程序开发人员使用适合其需求的架构。 Spring使我们能够指定所需的查询以便检索用户名密码和角色等信息。 我们的自定义表将与第一个示例的表完全不同。 drop table if exists Custom_Users; create table Custom_Users(id bigint auto_increment, username varchar(255), password varchar(255)); insert into Custom_Users(username,password) values(TestUser,TestPass);drop table if exists Custom_Roles; create table Custom_Roles(username varchar(255),authority varchar(255), UNIQUE(username,authority)); insert into Custom_Roles(username,authority) values(TestUser,superadmin); 为了在Spring Security中使用这些表我们必须传递Spring Security将使用的查询以检索所需的安全信息。 为此我们将创建一个安全配置该安全配置将设置所需的查询。 package com.gkatzioura.spring.security.config;import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Profile; import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder; import org.springframework.security.config.annotation.web.builders.HttpSecurity; import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;import javax.sql.DataSource;/*** Created by gkatzioura on 9/20/16.*/ EnableWebSecurity Profile(customquery) public class CustomQuerySecurityConfig extends WebSecurityConfigurerAdapter {Autowiredprivate DataSource dataSource;Autowiredpublic void configAuthentication(AuthenticationManagerBuilder auth) throws Exception {auth.jdbcAuthentication().dataSource(dataSource).usersByUsernameQuery(SELECT username,password,1 FROM Custom_Users where username?).authoritiesByUsernameQuery(SELECT username,authority FROM Custom_Roles where username?);}Overrideprotected void configure(HttpSecurity http) throws Exception {http.authorizeRequests().antMatchers(/public).permitAll().anyRequest().authenticated().and().formLogin().permitAll().and().logout().permitAll();}} 我们使用弹簧轮廓。 我们的spring配置文件将是“ customquery”因此CustomQuerySecurityConfig将绑定到“ customquery”配置文件。 为了运行出于方便起见我们必须在build.gradle文件中更改默认配置文件。 group com.gkatzioura version 1.0-SNAPSHOTbuildscript {repositories {mavenCentral()}dependencies {classpath(org.springframework.boot:spring-boot-gradle-plugin:1.4.0.RELEASE)} }apply plugin: java apply plugin: idea apply plugin: spring-bootsourceCompatibility 1.8repositories {mavenCentral() }dependencies {compile(org.springframework.boot:spring-boot-starter-web)compile(org.thymeleaf:thymeleaf-spring4)compile(org.springframework.boot:spring-boot-starter-security)compile(org.springframework:spring-jdbc)compile(com.h2database:h2:1.4.192)compile(org.slf4j:slf4j-api:1.6.6)compile(ch.qos.logback:logback-core:1.1.7)compile(ch.qos.logback:logback-classic:1.1.7)testCompile junit:junit:4.11 }bootRun {systemProperty spring.profiles.active, customquery } 运行应用程序问题 gradle bootRun 您可以在github上找到源代码 翻译自: https://www.javacodegeeks.com/2016/09/spring-boot-spring-security-jdbc-part-2.html
http://www.zqtcl.cn/news/372398/

相关文章:

  • 深圳福田做网站公司cname解析对网站影响
  • 做个网站要多久网站制作文案
  • 用户搭建网站wordpress代码实现头像
  • 和平区网站建设app和手机网站
  • 腾讯科技微信小程序电商seo是什么意思啊
  • 手机网站模板更换方法新闻客户端网站开发
  • 湛江定制建站黄页推广app软件
  • 盈利型网站做安卓app用什么软件
  • wordpress优秀移动站点西宁公司网站建设
  • 浙江网站建设的要求建设网上商城网站的目的和意义
  • 西峰住房和城乡建设局网站关于校园网站升级建设的报告
  • 网站怎么自适应屏幕大小达人室内设计网app
  • 做网站的软件名字全拼wordpress面包屑文字大小如何调整
  • 如何建设软件下载网站北京网站建设出名 乐云践新
  • 网站seo外包南宁网站建设活动
  • 汽车行业网站设计做互联网公司网站谈单模拟视频教学
  • 做网站界面设计注意什么江苏宿迁房产网
  • 传奇服务器网站如何建设帮人做兼职的网站
  • 织梦手机网站有广告位wordpress媒体库现实不全
  • 网站建设外包公司怎么样珠海网站排名提升
  • 电子商务网站建设结业论文做网站的图片字虚
  • 米拓建站最新进展注册做网站的公司有哪些
  • 设计网站设计wordpress 改系统
  • 学校网站建设评审会议通知网站是怎么赢利的
  • 手机网站建设 苏州优化网站哪个好
  • 网站建设流程方案通州网站建设公司
  • 免费的十大免费货源网站全国领先网站制作
  • 农业网站建设方案 ppt中国有什么网站做跨境零售
  • 网站文章结构变更怎么做301如何自己制作自己的网站
  • 网站网站平台建设方案免费制作桥架app