auth

Token service for authentication, support Redis, database, memory and JWT Token.

Лицензия

Лицензия

Группа

Группа

cn.spark2fire
Идентификатор

Идентификатор

auth
Последняя версия

Последняя версия

0.0.6
Дата

Дата

Тип

Тип

jar
Описание

Описание

auth
Token service for authentication, support Redis, database, memory and JWT Token.
Организация-разработчик

Организация-разработчик

Har01d
Система контроля версий

Система контроля версий

https://github.com/power721/auth

Скачать auth

Имя Файла Размер
auth-0.0.6.pom 6 KB
auth-0.0.6-javadoc.jar 245 KB
Обзор

Как подключить последнюю версию

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

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

  • auth-core
  • auth-db
  • auth-jwt
  • auth-redis

auth

Token service for authentication, support Redis, database, memory and JWT Token.

Designed for Spring Boot projects.

Maven

<dependency>
    <groupId>cn.har01d</groupId>
    <artifactId>auth</artifactId>
    <version>0.0.1</version>
</dependency>

Support Types

Redis

@EnableRedisToken

Database

@EnableDatabaseToken

Memory

Default

JWT

@EnableJwtToken

Endpoints

Login

POST /accounts/login
{
	"username": "user",
	"password": "bf3916a0-a7e0-4177-9b74-fa5b0b7e438f",
	"rememberMe": false
}

Logout

POST /accounts/logout
X-ACCESS-TOKEN: {{TOKEN}}

Get Principal

GET /accounts/principal
X-ACCESS-TOKEN: {{TOKEN}}

Token Usage

Add token in Header or Parameter X-ACCESS-TOKEN.

Configuration

cn:
  har01d:
    auth:
      idle-timeout: 30
      header-name: "X-ACCESS-TOKEN"
      table-name: "t_token"
      redis-prefix: "TOKEN:a:"
      jwt:
        secretKey: ""
        issuer: "Har01d"
        subject: "auth0"
        audience: "web"

Example

package cn.har01d.example

import cn.har01d.auth.annotation.EnableJwtToken
import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication

@SpringBootApplication
@EnableJwtToken
class ExampleApplication

fun main(args: Array<String>) {
    runApplication<ExampleApplication>(*args)
}

Версии библиотеки

Версия
0.0.6
0.0.5