Skip to main content

Add Phone Authentication to Your Java Backend

Set up carrier-grade phone authentication in your Spring Boot API using the Glide Java SDK.

1

Install the SDK

Add the Glide Java SDK to your project.

2

Create Service

Create a service that wraps the GlideClient.

3

Create REST Controller

Create endpoints for the frontend SDK:

  • /prepare - Initializes the auth session
  • /process - Routes to verifyPhoneNumber() or getPhoneNumber()
4

Request Model

Create a request model for the process endpoint.

5

Error Response Model

Create a response model for errors.

6

Next Steps

plugins {
    id 'org.springframework.boot' version '3.2.0'
    id 'io.spring.dependency-management' version '1.1.4'
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'com.glideidentity:glide-be-sdk-java:4.1.0'
    
    // Optional: Lombok for cleaner code
    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.projectlombok:lombok'
}
Read-only