smt-spring-security-parent

This is the parent project that groups all the smt-spring-security projects.

License

License

Categories

Categories

Security
GroupId

GroupId

com.github.shiver-me-timbers
ArtifactId

ArtifactId

smt-spring-security-parent
Last Version

Last Version

1.6
Release Date

Release Date

Type

Type

pom
Description

Description

smt-spring-security-parent
This is the parent project that groups all the smt-spring-security projects.
Source Code Management

Source Code Management

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

Download smt-spring-security-parent

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

  • smt-spring-security-jwt
  • smt-spring-security-stormpath

smt-spring-security-parent

Build Status Coverage Status Maven Central

This is the parent project that groups all the smt-spring-security libraries.

Libraries

smt-spring-security-jwt

This library will automatically enable stateless JWT authentication for any Spring Security configuration.

Usage

Annotation

@EnableWebSecurity
// Just add this annotation and configure Spring Security how ever you normally would.
@EnableJwtAuthentication
public class JwtSecurityConfiguration extends WebSecurityConfigurerAdapter {

    @Override
    protected final void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests().anyRequest().authenticated();
        http.formLogin().loginPage("/signIn").defaultSuccessUrl("/").permitAll();
        http.logout().logoutUrl("/signOut").logoutSuccessUrl("/");
    }

    @Autowired
    public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
        auth.inMemoryAuthentication().withUser("user").password("password").roles("USER");
    }
}

Adaptor

@EnableWebSecurity
public class JwtApplySecurityConfiguration extends WebSecurityConfigurerAdapter {

    @Override
    protected final void configure(HttpSecurity http) throws Exception {
        // Just apply this adaptor and configure Spring Security how ever you normally would.
        http.apply(jwt());
        http.formLogin().loginPage("/signIn").defaultSuccessUrl("/").permitAll();
        http.logout().logoutUrl("/jwt/signOut").logoutSuccessUrl("/");
    }

    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.inMemoryAuthentication().withUser("user").password("password").roles("USER");
    }
}

Versions

Version
1.6
1.5
1.4
1.3
1.2
1.1
1.0