GithubHelp home page GithubHelp logo

Comments (2)

oneone1995 avatar oneone1995 commented on June 11, 2024 1

@zhuangqi 请求token的时候是需要同时带上username、password和OAuth2授权模式才能请求到token的。如果username和password不匹配是不可能能请求到令牌的。密码错误是直接返回错误的response的,即在请求token的时候就已经验证password了
如果你想获取当前登录的用户信息(已经登录后),可以用下面的代码:
CustomUserDetails currentUser = (CustomUserDetails) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

from springboot-mybatis.

zhuangqi avatar zhuangqi commented on June 11, 2024

@oneone1995 谢谢你解释了我的疑惑,你的做法是对的,或许我要重新整理下OAuth的思路

from springboot-mybatis.

Related Issues (9)

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.