com.github.shawven:security-base

安全核心配置

License

License

Categories

Categories

Security
GroupId

GroupId

com.github.shawven
ArtifactId

ArtifactId

security-base
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

安全核心配置

Download security-base

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.shawven/security-base/ -->
<dependency>
    <groupId>com.github.shawven</groupId>
    <artifactId>security-base</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.shawven/security-base/
implementation 'com.github.shawven:security-base:1.0.0'
// https://jarcasting.com/artifacts/com.github.shawven/security-base/
implementation ("com.github.shawven:security-base:1.0.0")
'com.github.shawven:security-base:jar:1.0.0'
<dependency org="com.github.shawven" name="security-base" rev="1.0.0">
  <artifact name="security-base" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.shawven', module='security-base', version='1.0.0')
)
libraryDependencies += "com.github.shawven" % "security-base" % "1.0.0"
[com.github.shawven/security-base "1.0.0"]

Dependencies

compile (3)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-security jar 2.1.9.RELEASE
org.springframework.boot : spring-boot-configuration-processor jar 2.1.9.RELEASE
org.springframework.boot : spring-boot-autoconfigure jar 2.1.9.RELEASE

Project Modules

There are no modules declared in this project.

Security

只需要简单的配置就能接入OAuth2授权认证流程、短信登录、第三方登录等功能

spring-securiy

  • 基于Spring Security开发,更多信息请参考官方文档
  • 提供浏览器和APP环境spring-boot-starter支持,分别以session 和 token认保存会话
  • 支持表单登陆、短信登录、OAuth2授权登录、第三方登录(微信、QQ)

自动配置

spring-boot-starter支持,配置属性即可成功使用

security-app-spring-boot-starter

app环境支持,单独包

security-browser-spring-boot-starter

浏览器环境支持,单独包

security-verification-spring-boot-starter

短信、验证码模块,单独包/自动配置包

security-oauth2-autoconfigure

OAuth2自动配置包,

security-connect-autoconfigure

第三方登录自动配置,Spring Social社交登陆支持,在APP环境下APP拿到token,请求登录接口登录

按需加载

当引入了 app 或者 browser 主包时

  • 加载security-verification-spring-boot-starter 具备短信登录、发送短信、图形验证码功能
  • 加载security-oauth2-autoconfigure 具备token登录功能
  • 加载security-connect-autoconfigure 具备第三方登录功能
  • 只要加载security-oauth2-autoconfigure 则,第三方登录和短信登录无缝兼容OAuth2 Token方式

各模块智适应主要依赖AuthenticationSuccessHandler来处理是浏览器跳转、JSON响应、还是返回token

browser环境 -- 会话保持主要依赖session,支持传统页面跳转,和前后端分离json响应 App环境 -- 无状态,会话主要存储依赖redis,仅支持json响应

License

Security is Open Source software released under the Apache 2.0 license.

Versions

Version
1.0.0