totp-authenticator-spring-boot-autoconfigure

a spring boot starter for TOTP Authenticator

License

License

Categories

Categories

Spring Boot Container Microservices Auto Application Layer Libs Code Generators config Configuration
GroupId

GroupId

com.github.cheergoivan
ArtifactId

ArtifactId

totp-authenticator-spring-boot-autoconfigure
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

totp-authenticator-spring-boot-autoconfigure
a spring boot starter for TOTP Authenticator

Download totp-authenticator-spring-boot-autoconfigure

How to add to project

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

Dependencies

compile (3)

Group / Artifact Type Version
org.springframework.boot : spring-boot-autoconfigure jar
org.springframework.boot : spring-boot-configuration-processor jar
com.github.cheergoivan : totp-authenticator jar 1.0

test (1)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar

Project Modules

There are no modules declared in this project.

Spring Boot Starter for TOTP Authenticator

This is a spring boot starter for TOTP Authenticator.

Quick start

Add Maven dependency

<dependency>
    <groupId>com.github.cheergoivan</groupId>
    <artifactId>totp-authenticator-spring-boot-starter</artifactId>
    <version>1.0</version>
</dependency>

Usage

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import com.github.cheergoivan.totp.TOTPAuthenticator;

@RunWith(SpringRunner.class)
@SpringBootTest
public class TOTPAuthenticatorTest {
	
	@Autowired
	private TOTPAuthenticator totpAuthenticator;

	@Test
	public void contextLoads() {
		String secret = "ASDFGFHJKL";
		String totp = totpAuthenticator.generateTOTP(secret);
		System.out.println(totp);
		System.out.println(totpAuthenticator.validateTOTP(secret, totp));
	}
}

Configuration

Here are all supported configurations and their default values in TOTPAuthenticator.

iplay.totp.length=6
iplay.totp.time-step-size=30
iplay.totp.hash-algorithm=SHA_1
iplay.totp.allowed-past-validation-windows=2
iplay.totp.allowed-future-validation-windows=0
iplay.totp.decoder=com.github.cheergoivan.totp.decoder.SHA1Decoder

License

This project is licensed under the Apache 2 License.

Versions

Version
1.0