Skip to content

CMPE352‐Sequence Diagrams ‐ Session Management

Selman Akman edited this page Oct 15, 2025 · 1 revision
sequenceDiagram
    autonumber
    participant Client
    participant AuthMiddleware
    participant View
    participant TokenModel
    participant UserModel
    
    %% Token-based Authentication
    Client->>AuthMiddleware: Request with Authorization header
    AuthMiddleware->>TokenModel: validate(token)
    TokenModel-->>AuthMiddleware: Token valid, return user
    AuthMiddleware->>View: Request with authenticated user
    View->>View: Process request
    View-->>Client: Response
    
    %% Session Refresh
    Client->>AuthMiddleware: Request with expired token
    AuthMiddleware->>TokenModel: validate(token)
    TokenModel-->>AuthMiddleware: Token expired
    AuthMiddleware->>Client: 401 Unauthorized (Token expired)
    Client->>View: POST /api/auth/token/refresh (refresh_token)
    View->>TokenModel: Validate refresh token
    TokenModel-->>View: Refresh token valid
    View->>TokenModel: Generate new access token
    TokenModel-->>View: New access token
    View-->>Client: 200 OK (new_token)
    
    %% Multiple Device Management
    Client->>View: GET /api/auth/sessions (Authorization: Token)
    View->>TokenModel: Get all tokens for user
    TokenModel-->>View: List of active tokens with metadata
    View-->>Client: 200 OK (List of active sessions)
    
    Client->>View: DELETE /api/auth/sessions/{session_id}
    View->>TokenModel: delete(key)
    TokenModel-->>View: Success
    View-->>Client: 200 OK (Session terminated)
Loading

Labs

Team Members

Weekly Reports

Ahmet Okta
Barathan Aslan
Berke Kartal
Mehmet Çağlar Kurt
Mehmet Emin Atak
Muhammet Berkay Keskin
Mustafa Taha Söylemez
Nilsu Tüysüz
Selman Akman
Ömer Faruk Bayram

Meetings

Milestones

Templates

Research on Git

Projects

Project Resources

Software Design Diagrams

Documentation(Manuals & Research Doc)

CMPE352 Archive

Projects

Project Resources

Software Design Diagrams

Documentation(Manuals & Research Doc)



Documentation(Individual Contributions and/or Milestone Report)

Individual Contributions

Meeting Notes

Clone this wiki locally