• Spring Cloud authentication with JWT service


        @RequestMapping(value = "/authenticate", method = RequestMethod.POST)
        public ResponseEntity<AuthTokenDTO> authenticate(@Valid @RequestBody AuthenticationDTO authenticationDTO) {
            User user = userManagementService.authenticateUser(
                    authenticationDTO.getEmail(), authenticationDTO.getPassword());
            if (user != null) {
                return new ResponseEntity<>(buildAuthenticationTokenFromUser(user), HttpStatus.OK);
            } else {
                return new ResponseEntity<>(HttpStatus.UNAUTHORIZED);
            }
        }

    https://github.com/vdubois/spring-cloud-sample-authentication-service/blob/a442f7a10bf9529dbb68b669ed394fed51fcc330/src/main/java/io/github/vdubois/controller/AuthenticationController.java

  • 相关阅读:
    【git】之常用命令
    VueJs
    如何做技术选型
    用户登录验证注意事项
    npm xss
    express-session
    ejs、jade和dust
    XMLHttpRequest.responseType
    JS对象字面量
    安装Angulr CLI
  • 原文地址:https://www.cnblogs.com/softidea/p/7414495.html
Copyright © 2020-2023  润新知