Skip to content

As a greeter, I need to handle offline mode in the UI #33

Description

@guimard

User Story

As the LightDM greeter,
I need to handle offline mode in the UI,
So that users know when they're authenticating locally vs SSO.

Acceptance Criteria

  • Detect when LLNG server is unreachable
  • Display offline mode UI (username + local password)
  • Show cache expiration date
  • First login: prompt for local password creation after SSO
  • Clear visual indicator of offline status

Technical Details

Online Mode (First Login)

┌─────────────────────────────────────┐
│  [iframe SSO LLNG]                  │
│  ... SSO authentication ...         │
│                                     │
│  ✓ Authentication successful        │
│                                     │
│  Create a local password for        │
│  offline access:                    │
│                                     │
│  Password: [______________]         │
│  Confirm:  [______________]         │
│                                     │
│  [Skip]  [Create]                   │
└─────────────────────────────────────┘

Offline Mode

┌─────────────────────────────────────┐
│  ⚠ Offline Mode                     │
│  (SSO server unreachable)           │
│                                     │
│  Username: [______________]         │
│  Password: [______________]         │
│                                     │
│  [Login]                            │
│                                     │
│  Cache valid until: 2024-12-23      │
└─────────────────────────────────────┘

Implementation

// greeter/js/offline.js

async function checkServerAvailability() {
    try {
        await fetch(portalUrl + '/ping', { timeout: 5000 });
        return true;
    } catch {
        return false;
    }
}

async function initGreeter() {
    const online = await checkServerAvailability();
    if (online) {
        showSSOFrame();
    } else {
        showOfflineLogin();
    }
}

Files to Create

  • greeter/js/offline.js (new)
  • Modifications to greeter/index.html
  • Modifications to greeter/css/style.css

Component

Repo: llng-pam-module

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestphase-7Phase 7: Authentification Offlineuser-storyUser story

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions