Spring Boot Starter for JWT Security.
Easy JWT security for your Spring Boot applications
- Java 8
- Spring Boot 2.1.2
<repositories>
<repository>
<id>Sonatype</id>
<name>Sonatype's repository</name>
<url>https://oss.sonatype.org/content/groups/public/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<dependency>
<groupId>com.github.rbaul</groupId>
<artifactId>jwt-security-spring-boot-starter</artifactId>
<version>0.0.2-SNAPSHOT</version>
</dependency>repositories {
maven { url "https://oss.sonatype.org/content/groups/public" }
}
compile 'com.github.rbaul:jwt-security-spring-boot-starter:0.0.2-SNAPSHOT'Privilege must have prefix
ROLE_
security.jwt:
# token:
# expiration: 600000
# secret-key: secret-key-for-encryption
# header-name: Authorization
# password-strength: 7
# prefix: Bearer
# claims:
# roles-key: roles
# privilege-key: privileges
roles:
- name: Viewer
description: View user
privileges:
- ROLE_VIEW_PRIVILEGE
- name: Editor
description: Editor user
privileges:
- ROLE_CHANGE_PRIVILEGE
- ROLE_VIEW_PRIVILEGE
users:
- username: viewer
password: viewer
roles:
- Viewer
- username: editor
password: editor
roles:
- Editor
privileges:
- name: ROLE_CHANGE_PRIVILEGE
description: "Change privilege"
- name: ROLE_VIEW_PRIVILEGE
description: "View privilege"
# administrator:
# username: admin
# password: admin
# role-name: Administrator
# privilege-name: ROLE_ADMIN_PRIVILEGE