Skip to main content

Quick Start

Option A — Dev profile (H2, zero setup)

No Docker, no PostgreSQL, no credentials. Everything runs in-memory.

git clone https://github.com/AKHester-Technologies/ajfhir-smart-auth-server.git
cd ajfhir-smart-auth-server

mvn spring-boot:run -Dspring-boot.run.profiles=dev

Server starts at http://localhost:9000.

Open http://localhost:9000/portal and log in with the default credentials:

UsernamePasswordFHIR resource
dr.smithpasswordPractitioner/eProvider-ABC123
dr.jonespasswordPractitioner/eProvider-DEF456
Change default passwords

DataInitializer seeds these on first startup. Change them before any non-local deployment.


Option B — Production (PostgreSQL)

export DB_URL=jdbc:postgresql://localhost:5432/smartfhir
export DB_USER=smartfhir
export DB_PASSWORD=yourpassword
export FHIR_BASE_URL=http://localhost:8080/fhir
export ISSUER_URL=http://localhost:9000
export SMART_CLIENT_LAUNCH_URL=http://localhost:8081/launch

mvn spring-boot:run

Verify the server is running

# Health check
curl http://localhost:9000/actuator/health
# → {"status":"UP"}

# SMART discovery document
curl http://localhost:9000/.well-known/smart-configuration | python3 -m json.tool

Expected discovery response:

{
"authorization_endpoint": "http://localhost:9000/oauth2/authorize",
"token_endpoint": "http://localhost:9000/oauth2/token",
"jwks_uri": "http://localhost:9000/oauth2/jwks",
"issuer": "http://localhost:9000",
"capabilities": ["launch-ehr", "launch-standalone", "client-public", "..."],
"code_challenge_methods_supported": ["S256"]
}

Run tests

# All tests
mvn test

# Specific class
mvn test -Dtest=LaunchContextServiceTest

What gets seeded on first startup

DataInitializer runs once when the database is empty and creates:

Two test clinicians:

dr.smith  / password  → maps to Practitioner/eProvider-ABC123
dr.jones / password → maps to Practitioner/eProvider-DEF456

One registered SMART app:

client_id:     ajfhir-smart-client
redirect_uri: http://localhost:8080/callback
scopes: launch, openid, fhirUser, patient/Patient.rs,
patient/Condition.rs, patient/MedicationRequest.rs, ...

5. Run the tests

mvn test
# BUILD SUCCESS — runs against H2, no PostgreSQL required

The test suite includes unit tests, integration tests with the full Spring Boot context (@SpringBootTest), and scope logic tests. All run without external services.


Next steps