Spring Cloud authentication with JWT service

Posted 沧海一滴

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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

 

以上是关于Spring Cloud authentication with JWT service的主要内容,如果未能解决你的问题,请参考以下文章

问题 spring-cloud-config 和 spring-cloud-bus

spring cloud集成nacos

spring-cloud-config-server

Spring Cloud实战Spring Cloud GateWay服务网关

spring-cloud-config——Quick Start

Spring Cloud入门 - Spring Cloud保护机制