Add Phone Authentication to Your Go Backend
Set up carrier-grade phone authentication in your Go API using the Glide Go SDK.
Install the SDK
Install the Glide Go SDK.
Initialize the Client
Create a GlideClient with your client credentials and optional settings.
Create API Handlers
Create handlers for the frontend SDK endpoints:
Prepare- Initializes the auth sessionReportInvocation- Reports prompt was shown (fire-and-forget)Process- Routes toVerifyPhoneNumber()orGetPhoneNumber()Complete- Validates device binding codes (Link protocol only)
Error Handling
Handle SDK-specific errors using the glide.MagicalAuthError type.
Set Up Routes
Register your handlers and start the server.
Anti-Fraud Signals
Both VerifyPhoneNumber() and GetPhoneNumber() responses include SIM swap and device swap (IMEI change) fraud detection signals.
Each signal includes RiskLevel, AgeBand, CarrierName, and CheckedAt.
Device Binding (Link Protocol)
For Link protocol sessions (e.g., Verizon via App Clips), device binding is mandatory. Your backend generates a cryptographic code, hashes it, and sends the hash during Prepare(). After carrier auth, a second code arrives via URL fragment, and your backend validates both codes via Complete().
This prevents session fixation attacks where an attacker tricks a victim into authenticating on the attacker's session.
Next Steps
Your Go backend is ready!
go get github.com/GlideIdentity/glide-be-sdk-goRead-only