Git Product home page Git Product logo

micro-service-skeleton's Issues

Bad credentials

我在下了源码之后,用postman在调试http://localhost:9030/uaa/oauth/token
  一直报下面的错误
{
"timestamp": 1539248009450,
"status": 401,
"error": "Unauthorized",
"message": "Bad credentials",
"path": "/oauth/token"
}
配置文件就是从这里git下来的,有人能帮我一下吗,详细说一下吗

monitor那个工程现在是不是不能用了,一是pom.xml注了zipkin的全部,二是MonitorApplication的注解@EnableZipkinServer出错!

关于上述问题,在fank 帮助下,已经解决了,主要原因就是这一次升级后数据库脚本发生很大变化,原来rc_开头的表,全部换成sys_开头了,另外,原来oauth_client_details 表 webApp那条记录密码由原来的webApp换成123456再加密的!在此感谢fank,同时在这里也提出下一个问题就是monitor那个工程现在是不是不能用了,一是pom.xml注了zipkin的全部,二是MonitorApplication的注解@EnableZipkinServer出错!
望各位同仁或已解决了朋友,提出指教一下!

权限体系对比的是menu里面的code和request的URL地址?

您好,权限体系这块我看了您的实现方式,先获取用户role拥有的menu,再把menu的code放进去:
GrantedAuthority authority = new SimpleGrantedAuthority(menu.getCode());
grantedAuthorities.add(authority);
再跟requestURL对比,去判断是否有权限
antPathMatcher.match(authority.getAuthority(),requestUrl)
这个对比方式我不太理解工作的原理,是要求把menu和接口的地址写成一样的吗?

sql有错误

DROP TABLE IF EXISTS oauth_approvals;
CREATE TABLE oauth_approvals (
userId varchar(256) DEFAULT NULL,
clientId varchar(256) DEFAULT NULL,
scope varchar(256) DEFAULT NULL,
status varchar(10) DEFAULT NULL,
expiresAt timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
lastModifiedAt timestamp NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

[Err] 1067 - Invalid default value for 'lastModifiedAt'

sql导入报错!!!

只有一个APIGateway么

请问APIGateway层是只有一个对所有平台接入么,还是一个平台一个APIGateway,每个都不同,比如app应用和后台管理平台应用是对于两个不同的APIGateway,然后做不同的权限验证逻辑

走网关获取数据就是invalid_token, 这个是什么问题?

在Micro-Service-Skeleton-Gateway中有一段配置,如果是直接走网关user-info-uri: http://localhost:9030/uaa/user, 获取接口数据时显示的是invalid_token。

不走网关使用user-info-uri: http://localhost:9060/user 就是成功的,不知道有什么区别?
如果有多个Micro-Service-Skeleton-Auth服务,怎么实现高可用?难道要使用nginx进行代理吗?如果走网关应该是不需要的。

security:
oauth2:
resource:
#获得授权端的当前用户信息url
#user-info-uri: http://localhost:9030/uaa/user, 如果是这样就访问不了,不知道为啥子??
user-info-uri: http://localhost:9060/user
prefer-token-info: false

gateway 怎么拿到用户拥有的url的

认证服务器存的也只是 存的rolecode
Result<List> roleResult = roleService.getRoleByUserId(userVo.getId());
if (roleResult.getCode() != 100){
List roleVoList = roleResult.getData();
for (RoleVo role:roleVoList){
//角色必须是ROLE_开头,可以在数据库中设置
GrantedAuthority grantedAuthority = new SimpleGrantedAuthority("ROLE_"+role.getValue());
grantedAuthorities.add(grantedAuthority);
//获取权限
Result<List> perResult = permissionService.getRolePermission(role.getId());
if (perResult.getCode() != 100){
List permissionList = perResult.getData();
for (MenuVo menu:permissionList
) {
GrantedAuthority authority = new SimpleGrantedAuthority(menu.getCode());
grantedAuthorities.add(authority);
}
}
而gateway
if (antPathMatcher.match(authority.getAuthority(),requestUrl))

代码格式

代码格式太乱了,该对齐的没有对齐,看着太累

springcloud oauth2 集群配置

您好,如果我有多个autherver ,那么客户端应该怎么配置呢?难道cloud内部也要架个nginx么。。。

token存储数据库

打开 Token 存入数据库
在启动项目的时候会报错

  • redisTokenStore: defined by method 'redisTokenStore' in class path resource [com/wealthquery/wealthqueryoauth/config/AuthorizationServerConfig.class]
    • jdbcTokenStore: defined by method 'jdbcTokenStore' in class path resource [com/wealthquery/wealthqueryoauth/config/AuthorizationServerConfig.class]

服务消费和安全

您好,我想问一下,资源服务被添加了安全限制之后,那么多个资源服务之间使用feign进行服务消费怎么办?会遇到401问题,这个怎么解决?

真诚请教一下,关于不同用户role角色是怎么玩的?

@OverRide
public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
RcUserEntity userEntity = userService.findByUsername(username);
if (userEntity == null) {
throw new UsernameNotFoundException("用户:" + username + ",不存在!");
}
Set grantedAuthorities = new HashSet<>();
boolean enabled = true; // 可用性 :true:可用 false:不可用
boolean accountNonExpired = true; // 过期性 :true:没过期 false:过期
boolean credentialsNonExpired = true; // 有效性 :true:凭证有效 false:凭证无效
boolean accountNonLocked = true; // 锁定性 :true:未锁定 false:已锁定
List roleValues = roleService.getRoleValuesByUserId(userEntity.getId());
for (RcRoleEntity role:roleValues){
//角色必须是ROLE_开头,可以在数据库中设置
GrantedAuthority grantedAuthority = new SimpleGrantedAuthority("ROLE_"+role.getValue());
grantedAuthorities.add(grantedAuthority);
//获取权限
List permissionList = permissionService.getPermissionsByRoleId(role.getId());
for (RcMenuEntity menu:permissionList
) {
GrantedAuthority authority = new SimpleGrantedAuthority(menu.getCode());
grantedAuthorities.add(authority);
}
}
User user = new User(userEntity.getUsername(), userEntity.getPassword(),
enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, grantedAuthorities);
return user;
}

这一块,请问作者具体是在哪里相关联的,假设我想设置授权给其它应用的访问权限跟自己网站不一样,请问该怎么配置呢?可以加个联系方式吗?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.