Giter Club home page Giter Club logo

shirojwt's Introduction


shirojwt's People

Contributors

chunsiyang avatar dolyw avatar edinjohn avatar jiaj12 avatar pgm-sup 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shirojwt's Issues

SimpleAuthenticationInfo cannot be cast to AuthorizationInfo

遇到这么一个问题, shiro把SimpleAuthenticationInfo 换存进去后, 再要取出时, 无法转化为AuthorizationInfo;

shiro源码:

protected AuthorizationInfo getAuthorizationInfo(PrincipalCollection principals) {

        if (principals == null) {
            return null;
        }

        AuthorizationInfo info = null;

        if (log.isTraceEnabled()) {
            log.trace("Retrieving AuthorizationInfo for principals [" + principals + "]");
        }

        Cache<Object, AuthorizationInfo> cache = getAvailableAuthorizationCache();
        if (cache != null) {
            if (log.isTraceEnabled()) {
                log.trace("Attempting to retrieve the AuthorizationInfo from cache.");
            }
            Object key = getAuthorizationCacheKey(principals);
            **  info = cache.get(key); ** // 这里就是报错的地方
            if (log.isTraceEnabled()) {
                if (info == null) {
                    log.trace("No AuthorizationInfo found in cache for principals [" + principals + "]");
                } else {
                    log.trace("AuthorizationInfo found in cache for principals [" + principals + "]");
                }
            }
        }


        if (info == null) {
            // Call template method if the info was not found in a cache
            info = doGetAuthorizationInfo(principals);
            // If the info is not null and the cache has been created, then cache the authorization info.
            if (info != null && cache != null) {
                if (log.isTraceEnabled()) {
                    log.trace("Caching authorization info for principals: [" + principals + "].");
                }
                Object key = getAuthorizationCacheKey(principals);
                cache.put(key, info);
            }
        }

        return info;
    }

token并发刷新问题

示例代码中并发请求判断在有效时间内之后,登陆依然用的是旧的token(this.getSubject(request,response).login(oldToken)),这样shiro不是会继续报出token失效的异常吗,依然会登陆不成功

关于ExceptionAdvice的作用

ExceptionAdvice这个全局异常捕获不起作用吧 这个捕获应该只对进入controller的请求出错抛出的异常才起作用 才能拦截到吧 对于JwtFilter里面抛出的异常都是处理不到的

shiro会给token前加上Bearer字符串

String token = (String)authenticationToken.getCredentials();
这里获取的token前会被加上Bearer

原本应该是:
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXJyZW50VGltZU1pbGx ……

现在
Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXJyZW50VGltZU1pbGx ……

Token刷新并发处理

同时多个请求,第一个请求刷新了 Token,后面的请求还是携带的刷新前的旧 Token 就无法通过,该怎么处理

跨域sso问题

sso的各个系统在不同的域下,不同域下cookie vue_admin_template_token没法共享,有没有好的解决办法?

关于登录问题

这种写法好像只能一方登录,可以整合下多方登录与踢出吗?

疑似bug

我怎么觉得有问题
首先你写在config.properties里面的accessTokenExpireTime等没有读取到
其次是当token超时以后
执行executeLogin抛出了 AuthenticationException
这个异常你的程序里面没有处理
但是我看控制台抛出的是TokenExpiredException(这个好像是从verity那边跑出来的)
但是在JwtFilter里面的是AuthenticationException
所以没法刷新token
不知道是我自己问题还是你的问题,麻烦大佬看一下

redis的password被重置为null

image
报错信息如下
image
我给自己的redis设了一个密码,但是在config.properties配置的redis.password值并不能带入到对象中去,导致验证失败。(其他值如Host,port是正确的)
你可以试一下给redis设置个密码

重复请求会不会生成多个token

同一个页面一般情况下都会同时请求多个后台接口,当accessToken失效的时候,同时有多个请求,后端会不会刷新出多个newtoken的问题?

getCredentials() 还是 getPrincipal()的问题

您的代码中自定义的realm中,
在身份验证的方法, 为什么token是从getCredentials()中取呢? 不是应该从 getPrincipal()中取出吗?

源码中getCredentials()返回的应该是密码吧, 为什么要把token保存在密码中呢,
不是一般都是用用户ID去做Token的吗?

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.