ita-sso #574
Replies: 3 comments 1 reply
-
I have some questions: |
Beta Was this translation helpful? Give feedback.
-
I have 2 questions: |
Beta Was this translation helpful? Give feedback.
-
I understand these concepts, correct me if I'm wrong on something please:
|
Beta Was this translation helpful? Give feedback.
-
Server-to-Server SSO Service: Design and Development Guide
Part 1: Design Specifications
1. Introduction
This document presents the architecture and design considerations for a server-to-server Single Sign-On (SSO) service. The service will be developed using Koa in a Node.js environment, integrated with TypeScript for type safety, and PostgreSQL for data persistence.
2. Functional Requirements
2.1. User Registration
Users will register sending API Key from the service, nif/cif (will be used as id), email and password.
2.2. User Authentication
Services authenticate using Service Identifier and Password/API key.
Upon successful authentication, they will receive:
Authentication Token (AuthToken)
Refresh Token (RefreshToken)
2.3. Token Validation
An endpoint will validate the authenticity of provided AuthTokens.
Mechanism to renew AuthToken using RefreshToken.
2.4. User Metadata
A JSON field user_meta for users to store specific metadata in a JSON column
2.5. OpenAPI Swagger Endpoint
A Swagger endpoint for API documentation and interactivity.
3. Technical Specifications
3.1. Backend Framework
Koa.js with TypeScript.
3.2. Data Persistence
PostgreSQL Database
Table Name: user
Fields: id, email, password, and user_meta.
3.3. Password/API Key Management
Passwords/API keys hashed using bcrypt or similar.
4. Endpoints
(Refer to previous content for the endpoints and their descriptions)
4.1. Registration (POST /users/register)
Input: National ID, Email, Password
Output: Success/Failure message
4.2. Login (POST /users/login)
Input: National ID, Password
Output: AuthToken, RefreshToken
4.3. Validate AuthToken (GET /tokens/validate)
Input: AuthToken
Output: Valid/Invalid status
4.4. Renew AuthToken (POST /tokens/renew)
Input: RefreshToken
Output: New AuthToken
4.5. Swagger Documentation (GET /swagger)
Interactive API documentation using OpenAPI and Swagger UI.
5. Security Considerations
Use HTTPS.
Ensure secure token generation and validation.
Hash passwords/API keys securely.
Implement strict access control.
Part 2: Implementation
1 Initial folder structure
Beta Was this translation helpful? Give feedback.
All reactions