smt-spring-security-stateless

This library contains classes for configuring Spring Security to be stateless.

License

License

Categories

Categories

Security
GroupId

GroupId

com.github.shiver-me-timbers
ArtifactId

ArtifactId

smt-spring-security-stateless
Last Version

Last Version

2.0
Release Date

Release Date

Type

Type

jar
Description

Description

smt-spring-security-stateless
This library contains classes for configuring Spring Security to be stateless.
Source Code Management

Source Code Management

https://github.com/shiver-me-timbers/smt-spring-security-stateless

Download smt-spring-security-stateless

How to add to project

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

Dependencies

compile (2)

Group / Artifact Type Version
io.jsonwebtoken : jjwt jar 0.5.1
org.msgpack : msgpack jar 0.6.12

provided (2)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-security jar
javax.servlet : javax.servlet-api jar

test (6)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar
com.github.shiver-me-timbers : smt-random-strings jar 1.4
com.github.shiver-me-timbers : smt-random-numbers jar 1.5
org.slf4j : jcl-over-slf4j jar 1.7.12
ch.qos.logback : logback-classic jar 1.1.3
org.unitils : unitils-core jar 3.4.2

Project Modules

There are no modules declared in this project.

smt-spring-security-stateless

Build Status Coverage Status Maven Central

The purpose of this library is to provide a simple way of configuring Spring Security to be stateless.

Maven

<dependencies>
    <dependency>
        <groupId>com.github.shiver-me-timbers</groupId>
        <artifactId>smt-spring-security-stateless</artifactId>
        <version>2.0</version>
    </dependency>
</dependencies>

Usage

To register and customise the stateless configuration you must create a configuration class that extends the StatelessWebSecurityConfigurerAdapter.

@Configuration
public class SecurityConfiguration extends StatelessWebSecurityConfigurerAdapter {
}

Any further Spring Security configuration must be done in this configuration class through overriding the configureFurther(HttpSecurity) method. Configuring Spring Security in the traditional way by extending the WebSecurityConfigurerAdapter class and overriding its configure(HttpSecurity) method will break the stateless configuration.

@Configuration
public class SecurityConfiguration extends StatelessWebSecurityConfigurerAdapter {
    @Override
    protected void configureFurther(HttpSecurity http) throws Exception {
        http.authorizeRequests().anyRequest().authenticated();
        http.formLogin().loginPage("/signIn").permitAll();
        http.logout().logoutUrl("/signOut").logoutSuccessUrl("/");
    }
}

The stateless configuration it's self can be customised by overriding the other configure(...) and component methods in the StatelessWebSecurityConfigurerAdapter class.

Examples

A couple examples have been provide to show how to use this library.

smt-spring-security-stateless-basic

This example shows how to use the library with it's default configuration.

smt-spring-security-stateless-advanced

This example shows how you can customise the library to generate your own tokens and authentications.

Versions

Version
2.0
1.8
1.7
1.6
1.5
1.4
1.3
1.2
1.1
1.0