Spring cloud oauth2 研究第N天
来源:互联网 发布:怎么用python画图 编辑:程序博客网 时间:2024/05/22 14:35
抱歉,原先没有发表,是因为一直在参考
http://blog.csdn.net/j754379117/article/details/70176974
http://blog.csdn.net/j754379117/article/details/70175198
https://spring.io/guides/tutorials/spring-boot-oauth2/
现在配置好,运行报
PreparedStatementCallback; bad SQL grammar [select username,password,enabled from users where username = ?]; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'users' doesn't exist
不难看出在Spring Security源码中导数据库中查询用户名密码,及其用户对应的权限是其固定写在代码里面的,这就是为什么网上的一些小的demo中数据库为什么这么创建的原因。下面给出MySQL创建这两张的SQL语句及其插入数据的相关语句:
- create table users(
- username varchar(50) not null primary key,
- password varchar(50) not null,
- enabled boolean not null
- );
- create table authorities (
- username varchar(50) not null,
- authority varchar(50) not null,
- constraint fk_authorities_users foreign key(username) references users(username)
- );
- create unique index ix_auth_username on authorities (username,authority);
- insert into users(username,password,enabled) values('admin','admin',true);
- insert into users(username,password,enabled) values('user','user',true);
- insert into authorities(username,authority) values('admin','ROLE_ADMIN');
- insert into authorities(username,authority) values('admin','ROLE_USER');
- insert into authorities(username,authority) values('user','ROLE_USER');
阅读全文
0 0
- Spring cloud oauth2 研究第N天
- Spring boot oauth2 研究第N天 action 2
- Spring Cloud OAuth2 & Zuul
- Spring Cloud OAuth2 认证流程
- Spring cloud oauth2.0学习总结
- Spring Cloud OAuth2 # Access Token中继流程
- spring cloud oauth2 feign 遇到的坑
- 使用Spring Cloud Security OAuth2搭建授权服务
- 使用Spring Cloud Security OAuth2搭建授权服务
- 利用curl模拟 移动端 接入 spring cloud security OAuth2
- 使用Spring Cloud Security OAuth2搭建授权服务
- 解决 Spring Cloud Security OAuth2搭建授权服务
- Spring cloud oauth2.0的源码解析与实践Demo
- 使用SPRING CLOUD SECURITY OAUTH2搭建授权服
- Spring Cloud OAuth2、 Actuator、Docker联配最佳实践
- 使用Spring Cloud Security OAuth2搭建授权服务
- springboot-Spring Cloud Security- Spring Cloud OAuth2 -token-redis 接口权限01
- 第一篇 Spring Cloud概述
- mongodb 数据库封装DB类
- 记录一个BUG,用==赋值。。。GG
- code
- leetcode练习 Course Schedul
- 泛型委托
- Spring cloud oauth2 研究第N天
- springboot activemq 2 持久化消息 与 持久化订阅
- Oracle之index_desc索引之排序升降
- 常见排序算法-php 1.归并排序 $a = [1, 4, 6, 8, 10, 14, 16]; $b = [2, 3, 5, 8, 9, 11]; function merge_sort($a,
- 服务器使用Tomcat配置server.xml文件通过域名直接跳转到项目
- 数据库的发明者
- sftp error: Couldn't canonicalize
- HTTP缓存机制一二三
- 集合数据类型的操作