PigxSsoClientDemoApplication.java 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2018-2025, lengleng All rights reserved.
  3. *
  4. * Redistribution and use in source and binary forms, with or without
  5. * modification, are permitted provided that the following conditions are met:
  6. *
  7. * Redistributions of source code must retain the above copyright notice,
  8. * this list of conditions and the following disclaimer.
  9. * Redistributions in binary form must reproduce the above copyright
  10. * notice, this list of conditions and the following disclaimer in the
  11. * documentation and/or other materials provided with the distribution.
  12. * Neither the name of the pig4cloud.com developer nor the names of its
  13. * contributors may be used to endorse or promote products derived from
  14. * this software without specific prior written permission.
  15. * Author: lengleng (wangiegie@gmail.com)
  16. */
  17. package com.pig4cloud.pigx.sso;
  18. import org.springframework.boot.SpringApplication;
  19. import org.springframework.boot.autoconfigure.security.oauth2.client.EnableOAuth2Sso;
  20. import org.springframework.cloud.client.SpringCloudApplication;
  21. /**
  22. * @author lengleng
  23. * @date 2018年11月15日17:06:26
  24. * <p>
  25. * 单点登录客户端
  26. * 1. 启动实例访问:http://localhost:4040/sso1/ 提示登录,然后获取到用户信息
  27. * 2. 再启动一个实例: http://localhost:4041/sso1/ 不需要登录即可获取当前用户信息
  28. */
  29. @EnableOAuth2Sso
  30. @SpringCloudApplication
  31. public class PigxSsoClientDemoApplication {
  32. public static void main(String[] args) {
  33. SpringApplication.run(PigxSsoClientDemoApplication.class, args);
  34. }
  35. }