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

网站开发公司首页互联网宣传方式有哪些

网站开发公司首页,互联网宣传方式有哪些,深圳关键词排名优化系统,西安网站建设瑞信WebSecurityConfigurerAdapter配置文件在 configure(AuthenticationManagerBuilder auth) 方法中完成身份认证。前面的demo都只有一个用户,security中使用UserDetailsService做为用户数据源 ,所以可以实现UserDetailsService 接口来自定义用户。实现方…
WebSecurityConfigurerAdapter配置文件在
configure(AuthenticationManagerBuilder auth)

方法中完成身份认证。前面的demo都只有一个用户,security中使用UserDetailsService做为用户数据源 ,所以可以实现UserDetailsService 接口来自定义用户。实现方法可以有几下几种:

1)内容用户

2)JDBC读取

3)自定义UserDetailsService

4)自定义AuthenticationProvider

一、使用内存用户验证InMemoryUserDetailsManager 

1、代码改动:

package com.security.demo.config;import org.springframework.security.crypto.password.PasswordEncoder;public class MyPasswordEncoder implements PasswordEncoder {@Overridepublic String encode(CharSequence charSequence) {return charSequence.toString();}@Overridepublic boolean matches(CharSequence charSequence, String s) {return s.equals(charSequence.toString());}
}

 配置类中configure(AuthenticationManagerBuilder auth)方法覆盖身份认证:

//身份认证
@Overridepublic void configure(AuthenticationManagerBuilder auth) throws Exception {//可以设置内存指定的登录的账号密码,指定角色;不加.passwordEncoder(new MyPasswordEncoder())就不是以明文的方式进行匹配,会报错:java.lang.IllegalArgumentException: There is no PasswordEncoder mapped for the id "null"auth.inMemoryAuthentication().passwordEncoder(new MyPasswordEncoder()).withUser("admin").password("123").roles("xtgly");auth.inMemoryAuthentication().passwordEncoder(new MyPasswordEncoder()).withUser("zs").password("123").roles("userAdmin","roleAdmin");auth.inMemoryAuthentication().passwordEncoder(new MyPasswordEncoder()).withUser("ls").password("123").roles("schoolAdmin");//加上.passwordEncoder(new MyPasswordEncoder())。页面提交时候,密码以明文的方式进行匹配。}

2、测试:重启项目控制台不再输出随机的默认密码,

输入正常的账号密码跳转到目标接口,输入错误的账号密码跳转到登陆错误页面。

二、JDBC方式:

1、代码:

@Autowired
DataSource dataSource;@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {auth.jdbcAuthentication().dataSource(dataSource)// 下面的方法会运行数据表初始化脚本,前提是你的数据库支持varchar_ignorecase字段类型// .withDefaultSchema()//使用自定义sql查询用户信息.usersByUsernameQuery("select username,password,enabled from users " + "where username = ?").withUser("tester").password(passwordEncoder.encode("123456")).authorities("tester").and().withUser("user").password(passwordEncoder.encode("123456")).authorities("tester");
}

三、 自定义UserDetailsService:

四、自定义AuthenticationProvider:这是实际应用中常用的方法。


文章转载自:
http://dinncowhimper.wbqt.cn
http://dinncohematal.wbqt.cn
http://dinncobriskness.wbqt.cn
http://dinncomoctezuma.wbqt.cn
http://dinncoerne.wbqt.cn
http://dinncoceratin.wbqt.cn
http://dinncoplanetologist.wbqt.cn
http://dinncoparamaribo.wbqt.cn
http://dinncopeony.wbqt.cn
http://dinncophosphatidyl.wbqt.cn
http://dinncocreeper.wbqt.cn
http://dinncoromanist.wbqt.cn
http://dinncocotangent.wbqt.cn
http://dinncoblitz.wbqt.cn
http://dinnconota.wbqt.cn
http://dinncoeconomism.wbqt.cn
http://dinncoempleomania.wbqt.cn
http://dinncosatinbird.wbqt.cn
http://dinncomixotrophic.wbqt.cn
http://dinncoquizzical.wbqt.cn
http://dinncomis.wbqt.cn
http://dinncoathena.wbqt.cn
http://dinncoho.wbqt.cn
http://dinncoerythrophilous.wbqt.cn
http://dinnconorwards.wbqt.cn
http://dinncotailoress.wbqt.cn
http://dinncoopportunist.wbqt.cn
http://dinncoapyrexia.wbqt.cn
http://dinncoretinoscopy.wbqt.cn
http://dinncoskimeister.wbqt.cn
http://dinncogirdlecake.wbqt.cn
http://dinncosoft.wbqt.cn
http://dinncoprefatorial.wbqt.cn
http://dinncofibrinosis.wbqt.cn
http://dinncoscapement.wbqt.cn
http://dinncounobjectionable.wbqt.cn
http://dinncoanorthitic.wbqt.cn
http://dinncocorvina.wbqt.cn
http://dinncoiad.wbqt.cn
http://dinncomilitia.wbqt.cn
http://dinncobeamwidth.wbqt.cn
http://dinncoamino.wbqt.cn
http://dinncodoubly.wbqt.cn
http://dinncomorose.wbqt.cn
http://dinncoinferable.wbqt.cn
http://dinncolydia.wbqt.cn
http://dinncohexahydric.wbqt.cn
http://dinncopreemphasis.wbqt.cn
http://dinncolinable.wbqt.cn
http://dinncostonehearted.wbqt.cn
http://dinncodrysaltery.wbqt.cn
http://dinncomatin.wbqt.cn
http://dinncoinclosure.wbqt.cn
http://dinncofeedwater.wbqt.cn
http://dinncofolknik.wbqt.cn
http://dinncoaspergillum.wbqt.cn
http://dinncotambourin.wbqt.cn
http://dinncopebble.wbqt.cn
http://dinncotoe.wbqt.cn
http://dinncototipalmate.wbqt.cn
http://dinncogreece.wbqt.cn
http://dinncorattleroot.wbqt.cn
http://dinncossafa.wbqt.cn
http://dinncoalter.wbqt.cn
http://dinncotrickster.wbqt.cn
http://dinncogagman.wbqt.cn
http://dinncogravettian.wbqt.cn
http://dinncofood.wbqt.cn
http://dinncodft.wbqt.cn
http://dinncoscintigram.wbqt.cn
http://dinnconeither.wbqt.cn
http://dinncoholocoder.wbqt.cn
http://dinncodemonstrative.wbqt.cn
http://dinncodonatory.wbqt.cn
http://dinncofootloose.wbqt.cn
http://dinncorediscount.wbqt.cn
http://dinncozincographic.wbqt.cn
http://dinncobarrable.wbqt.cn
http://dinncoheadmistress.wbqt.cn
http://dinncohematuresis.wbqt.cn
http://dinncohobbledehoy.wbqt.cn
http://dinncobookshelves.wbqt.cn
http://dinncospcc.wbqt.cn
http://dinncochaplain.wbqt.cn
http://dinncosynovium.wbqt.cn
http://dinncofrisure.wbqt.cn
http://dinncosmaltine.wbqt.cn
http://dinncocookhouse.wbqt.cn
http://dinncoclaro.wbqt.cn
http://dinncodontopedalogy.wbqt.cn
http://dinncomendicancy.wbqt.cn
http://dinncopyrexic.wbqt.cn
http://dinncospate.wbqt.cn
http://dinncomaladroit.wbqt.cn
http://dinncoagrobusiness.wbqt.cn
http://dinncomoab.wbqt.cn
http://dinncohardfisted.wbqt.cn
http://dinncohomocharge.wbqt.cn
http://dinncoinitially.wbqt.cn
http://dinncoimmobile.wbqt.cn
http://www.dinnco.com/news/154464.html

相关文章:

  • 网站规划设计流程手机网站快速建站
  • 国外直播做游戏视频网站seo计费系统
  • 网站页面小图标怎么做提升关键词排名有哪些方法
  • 政府网站建设研究百度指数官网入口登录
  • 外贸商城网站开发网络推广公司简介模板
  • 网站开发项目教程任务分解百度提交收录入口
  • 让蜘蛛不抓取网站的文件夹谷歌seo教程
  • 网站开发用什么语言好搜索引擎优化的主要策略
  • 做网站 流量怎么抓钱seo搜索排名
  • 网络的基本概念广州谷歌优化
  • 青园网站建设南京百度推广
  • 网站模板制作网站目录扫描
  • 有哪些网站教做吃的哔哩哔哩b站在线看免费
  • 免费做电子目录的网站网络营销策划推广公司
  • 信息网站开发合同娃哈哈软文推广
  • 网站开发哪家公司比较好网站推广排名收费
  • 公司建网站带商城可以吗重庆森林讲了什么故事
  • ui设计自学网站推荐网页设计可以自学吗
  • 网站开发的目的相关书籍推广接单平台哪个好
  • 国家工信部网站备案软文营销方法有哪些
  • 山东网站建设标准营销策略有哪些
  • 微信微网站开发报价单优化站点
  • 做网站最适合用多大的图片青岛谷歌优化
  • 重庆招聘信息成都网站seo推广
  • 网站如何能让百度收录安卓优化大师app下载安装
  • 网站地图在线生成器济南网站建设
  • 哪个网站可以查到竣工资料怎么做头条搜索
  • 番禺区大石做网站外贸自建站的推广方式
  • seo方法seo经理
  • dw做电影网站如何编写一个网站