Git Product home page Git Product logo

securing-spring-boot-with-jwts's People

Contributors

freew01f avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

securing-spring-boot-with-jwts's Issues

token怎么刷新呢

@freew01f 谢谢代码,很清楚。

我实际中,在user登陆后生成token保存到数据库,下一次登陆要求user生成新的token,并更新数据库里的token;之前的token作废。那么如何刷新token呢,现在用前后两个token都可以通过验证(两个token都没有逾期)

谢谢

对于restful接口怎么判断用户是否有权限

举个例子 用户相关的API
GET /users
POST /users
DELETE /users/{id}

路径都是users 怎么判断其权限

配置
.anyRequest().access("@authorityService.hasPermission(request,authentication)");
我是采用的
自定义
public boolean hasPermission(HttpServletRequest request, Authentication authentication)

    	UserDetails userDetails = (UserDetails)authentication.getPrincipal();
    	Collection<? extends GrantedAuthority> authorities = userDetails.getAuthorities();
		String uri = request.getRequestURI();
		AntPathMatcher antMatcher = new AntPathMatcher();
		for (GrantedAuthority authoritie : authorities) {
			if(antMatcher.match(authoritie.getAuthority(), uri)){
				return true;
			}
		}
		return false;

现在是想 取出 请求方法request..getRequestMethod();
和url 一起来判断

你有什么思路?

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.