Skip to content

DolXeGoD/passwordless-x1280-spring-boot-rest-api-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Passwordless X1280 REST API

This project is a Spring Boot REST API integration example for Passwordless X1280 provided by Password Alliance.

Overview

This is a backend REST API service that integrates with Password Alliance's Passwordless X1280 authentication system. It provides both traditional password-based authentication and passwordless authentication capabilities, allowing users to authenticate using their mobile devices with QR code registration.

Tech Stack

  • Java: 21
  • Spring Boot: 3.5.9
  • Build Tool: Gradle
  • MySQL: 8.x
  • Lombok: Latest

API Endpoints

Authentication APIs

POST /api/auth/login

Login with ID and password.

Request:

{
  "id": "user123",
  "password": "password123"
}

POST /api/auth/register

Register a new user.

Request:

{
  "id": "user123",
  "password": "password123"
}

POST /api/auth/change-password

Change user password.

Request:

{
  "id": "user123",
  "newPassword": "newpassword123"
}

DELETE /api/auth/account

Delete current user account (requires login).

POST /api/auth/logout

Logout current user.

GET /api/auth/status

Check if user is logged in.

Passwordless APIs

POST /api/passwordless/verify-access

Verify user credentials for passwordless management.

Parameters:

  • userId (String): User ID
  • password (String): User password

GET /api/passwordless/registration-status

Check if user has registered passwordless authentication.

Parameters:

  • userId (String): User ID

POST /api/passwordless/register

Register user for passwordless authentication.

Request:

{
  "userId": "user123",
  "token": "verification-token"
}

POST /api/passwordless/withdraw

Withdraw from passwordless authentication.

Request:

{
  "userId": "user123",
  "token": "verification-token"
}

GET /api/passwordless/one-time-token

Get one-time token for passwordless authentication.

Parameters:

  • userId (String): User ID

POST /api/passwordless/authenticate

Request passwordless authentication.

Parameters:

  • userId (String): User ID

GET /api/passwordless/auth-result

Check passwordless authentication result.

Parameters:

  • userId (String): User ID
  • sessionId (String): Session ID from authentication request

POST /api/passwordless/cancel

Cancel passwordless authentication request.

Parameters:

  • userId (String): User ID
  • sessionId (String): Session ID from authentication request

Database Setup

Create MySQL database and table:

CREATE DATABASE passwordless CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

USE passwordless;

CREATE TABLE userinfo (
    id VARCHAR(50) PRIMARY KEY,
    pw VARCHAR(256) NOT NULL,
    regdate TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

Configuration

Edit src/main/resources/application.properties:

# DataSource
spring.datasource.url=jdbc:mysql://localhost:3306/passwordless
spring.datasource.username=your_username
spring.datasource.password=your_password

# Passwordless
passwordless.corp-id=your_corp_id
passwordless.server-id=your_server_id
passwordless.server-key=your_server_key
passwordless.rest-check-url=http://your-passwordless-server:11040
passwordless.push-connector-url=ws:your-passwordless-server:15010

About

Spring Boot REST API integration example for Passwordless X1280 provided by Password Alliance

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages