账户中心-SpringBoot集成工具

xielq a1c2f3f642 init from phab 4 years ago
src a1c2f3f642 init from phab 4 years ago
Readme.md a1c2f3f642 init from phab 4 years ago
build.gradle a1c2f3f642 init from phab 4 years ago
settings.gradle a1c2f3f642 init from phab 4 years ago

Readme.md

功能

适用于spring boot项目,实现用户拦截与用户信息获取

原理

基于cookie身份标识uid识别用户认证信息

使用方法

Gradle依赖

compile "com.uas.account:sso-integration:1.0-SNAPSHOT"

添加配置注入

@EnableSSO
public class MyApplication {

添加sso配置

    sso:
      secretKey: 0taQcW073Z7G628g5H

使用

    @RequestMapping({"/", "/sso"})
    public ResponseEntity test() {
        // ssoToken
        return ResponseEntity.ok(SSO.get());
    }

    @RequestMapping("/user")
    public ResponseEntity test2() {
        // ssoToken.data
        return ResponseEntity.ok(UserView.get());
    }