This project provides a minimal code demonstration for integrating Logto authentication in a PassportJS application. It utilizes the passport-openidconnect
plugin, offering a simple yet effective way to incorporate Logto for authentication purposes.
To get started:
- In Logto Console, create an application with type "Traditional Web App".
- Obtain the necessary values from the Application details in Logto.
- Set up the following environment variables:
Environment Variable | Description | Example |
---|---|---|
APP_ID |
App ID from Logto | 4ukboxxxxxxxxx |
APP_SECRET |
App Secret from Logto | 5aqccxxxxxxx |
ENDPOINT |
Logto Endpoint | https://g5xxx.logto.app/ |
The demonstration includes four key routes:
/sign-in
- Begins the sign-in process./sign-out
- Triggers the sign-out process./callback
- Manages the callback post-authentication./
(index) - Displays login status and user information if logged in, or a sign-in button if not.