security-oauth2-autoconfigure

OAuth2 for Spring Boot starter

License

License

Categories

Categories

H2 Data Databases Security OAuth2 Auto Application Layer Libs Code Generators config Configuration
GroupId

GroupId

com.github.shawven
ArtifactId

ArtifactId

security-oauth2-autoconfigure
Last Version

Last Version

2.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

security-oauth2-autoconfigure
OAuth2 for Spring Boot starter
Source Code Management

Source Code Management

https://github.com/shawven/security

Download security-oauth2-autoconfigure

How to add to project

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

Dependencies

compile (6)

Group / Artifact Type Version
com.github.shawven : security-oauth2 jar 2.1.0
com.github.shawven : security-verification Optional jar 2.1.0
com.github.shawven : security-authorization-autoconfigure jar 2.1.0
org.springframework.data : spring-data-redis Optional jar
org.springframework.boot : spring-boot-autoconfigure jar 2.2.5.RELEASE
org.springframework.boot : spring-boot-configuration-processor Optional jar 2.2.5.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
2.1.0
2.0.7
2.0.6
2.0.5
2.0.4
2.0.3
2.0.2
2.0.1
2.0.0