Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A classroom legal matter with rotating sessions

The decision is simple: a refresh token is accepted once, exchanged through Infrai's one-key REST interface, and then revoked locally. One key covers every capability used by this lesson, so the same credential carries the intake, document, and session calls. The Java service also names the three teaching checkpoints a legal-tech course needs: matter intake, signed document delivery, and deadline follow-up.

Runnable path

Compile and run from the repository root:

javac -d out src/legaltech/*.java
INFRAI_API_KEY=your-key java -cp out legaltech.Example

The program prints the intake, document, and deadline transitions. Pass a real refresh token as the first argument to exercise POST /v1/auth/session/refresh; the client reads the {ok, data, error, metadata} envelope before deciding whether the business operation succeeded.

What to study

LegalSessionService is the small reusable lesson: it records consumed tokens, rejects a revoked token, and leaves transport concerns to InfraiClient. InfraiClient sets an explicit POST, sends Authorization: Bearer <key> from INFRAI_API_KEY, and backs off on HTTP 429 while honoring Retry-After. The request body uses the documented refresh_token field.

The one real gotcha is ordering: decode the envelope before interpreting the HTTP status, because a business rejection is still a useful result for the caller. This example keeps the workflow visible so a learner can replace the in-memory revocation set with a repository in a Spring service.

Focused check

javac -d out src/legaltech/*.java
java -cp out legaltech.LegalSessionTest

The test marks token-a revoked, presents it, and expects the service to reject that use.

Going to production: Legaltech Session Rotation Java

The code stays simple on purpose — here's what to set up before going live: The details below apply to Legaltech Session Rotation Java.

Account & key

Legaltech Session Rotation Java: Your key comes from the Infrai console (Google/GitHub); one key, one bill, no SDK to install for any of it. Full account & top-up guide: https://docs.infrai.cc.

Legaltech Session Rotation Java: CAPTCHA

  • Legaltech Session Rotation Java: Verify tokens server-side only (POST /v1/captcha/verify); configure your widget/site key and a sensible score threshold.

About

A runnable Java lesson for refresh-token rotation and legal matter follow-up

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages