-
Couldn't load subscription status.
- Fork 0
Test eService implementation #97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ndefokou
wants to merge
15
commits into
main
Choose a base branch
from
eID-service-implementation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
facb739
implementing the eid-service
ndefokou 18bcb8d
implementing the eid-service
ndefokou a93fa81
implementing the eid-service
ndefokou 7c19c36
feat: Implement eID service and fix gitignore
ndefokou 01aa92b
fix():file formating
ndefokou 48d9d18
Adding error
ndefokou 76b1de4
Adding error
ndefokou 3400587
get server info
ndefokou c361eaf
fix():README
ndefokou a72f724
fix():Formating
ndefokou 7ff1c57
fix():README
ndefokou da9e164
fix():formating
ndefokou 1f16ad5
removing the quick start file
ndefokou cb7cdda
fix():README
ndefokou e45f46f
fix():README
ndefokou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| [submodule "eID-Service"] | ||
| path = eID-Service | ||
| url = https://github.com/ADORSYS-GIS/EID-Service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # eID-Server Configuration | ||
| EID_SERVER_URL=https://localhost:3000/eid | ||
| EID_SERVER_ADDRESS=https://localhost:3000/eid | ||
|
|
||
| # Application Configuration | ||
| NEXT_PUBLIC_BASE_URL=https://localhost:8080 | ||
| PORT=8443 | ||
|
|
||
| # HTTPS Server Configuration | ||
| HTTPS_CERT_PATH=./certs/fullchain.pem | ||
| HTTPS_KEY_PATH=./certs/client.key | ||
|
|
||
| # TLS/mTLS Configuration (optional) | ||
| # EID_SERVER_TLS_MODE=normal | ||
| # EID_SERVER_CERT_PATH=path/to/client-cert.pem | ||
| # EID_SERVER_KEY_PATH=path/to/client-key.pem | ||
| # EID_SERVER_CA_PATH=path/to/ca-cert.pem | ||
| # EID_SERVER_REJECT_UNAUTHORIZED=false | ||
|
|
||
| # Security | ||
| NODE_ENV=development |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,172 @@ | ||
| # TLS Certificate Configuration Guide | ||
|
|
||
| This guide explains how to configure TLS certificates for the eID Test eService, supporting both normal TLS with eID-Client and mTLS with eID-Server. | ||
|
|
||
| ## Certificate Overview | ||
|
|
||
| The eService supports flexible TLS configuration: | ||
|
|
||
| - **HTTPS Server**: Self-signed certificates accepted for development | ||
| - **eID-Client Communication**: Normal TLS (server certificates) | ||
| - **eID-Server Communication**: Optional mTLS (mutual TLS with client certificates) | ||
|
|
||
| ## Certificate Requirements | ||
|
|
||
| ### For HTTPS Server (eService) | ||
|
|
||
| - **Server Certificate** (PEM format) | ||
| - **Private Key** (PEM format) | ||
| - **CA Certificate** (optional, for certificate chain validation) | ||
|
|
||
| ### For eID-Server Communication (mTLS) | ||
|
|
||
| - **Client Certificate** (PEM format) | ||
| - **Client Private Key** (PEM format) | ||
| - **CA Certificate** (optional, for server certificate validation) | ||
|
|
||
| ## Quick Setup | ||
|
|
||
| ### 1. Generate Self-Signed Certificates (Development) | ||
|
|
||
| ```bash | ||
| # Generate private key | ||
| openssl genrsa -out server.key 2048 | ||
|
|
||
| # Generate certificate signing request | ||
| openssl req -new -key server.key -out server.csr -subj "/C=DE/ST=Berlin/L=Berlin/O=eID-Test-eService/CN=localhost" | ||
|
|
||
| # Generate self-signed certificate (valid for 1 year) | ||
| openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt | ||
|
|
||
| # Clean up | ||
| rm server.csr | ||
| ``` | ||
|
|
||
| ### 2. Configure Environment Variables | ||
|
|
||
| Create or update your `.env.local` file: | ||
|
|
||
| ```bash | ||
| # HTTPS Server Configuration | ||
| HTTPS_CERT_PATH=./certs/server.crt | ||
| HTTPS_KEY_PATH=./certs/server.key | ||
| HTTPS_CA_PATH=./certs/ca.crt # Optional | ||
|
|
||
| # eID-Server Configuration | ||
| EID_SERVER_URL=https://your-eid-server.com/eIDService | ||
| EID_SERVER_TLS_MODE=mtls # or 'normal' for regular TLS | ||
|
|
||
| # mTLS Certificates (for eID-Server communication) | ||
| EID_SERVER_CERT_PATH=./certs/client.crt | ||
| EID_SERVER_KEY_PATH=./certs/client.key | ||
| EID_SERVER_CA_PATH=./certs/server-ca.crt # Optional | ||
|
|
||
| # Alternative: Direct PEM content (instead of file paths) | ||
| EID_SERVER_CERT=-----BEGIN CERTIFICATE----- | ||
| MIIDtTCCAp2gAwIBAgIJAKg... | ||
| -----END CERTIFICATE----- | ||
|
|
||
| EID_SERVER_KEY=-----BEGIN PRIVATE KEY----- | ||
| MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC... | ||
| -----END PRIVATE KEY----- | ||
|
|
||
| # Base URL (will auto-detect HTTPS) | ||
| NEXT_PUBLIC_BASE_URL=https://localhost:3000 | ||
| ``` | ||
|
|
||
| ## TLS Modes Explained | ||
|
|
||
| ### Normal TLS Mode (`EID_SERVER_TLS_MODE=normal`) | ||
|
|
||
| - **Use case**: Standard TLS connection to eID-Server | ||
| - **Requirements**: Server certificate validation only | ||
| - **Certificates**: Optional client certificates | ||
|
|
||
| ### Mutual TLS Mode (`EID_SERVER_TLS_MODE=mtls`) | ||
|
|
||
| - **Use case**: Mutual authentication with eID-Server | ||
| - **Requirements**: Both client and server certificates | ||
| - **Certificates**: Mandatory client certificate + key | ||
|
|
||
| ## Certificate File Structure | ||
|
|
||
| ```toml | ||
| your-project/ | ||
| ├── certs/ | ||
| │ ├── server.crt # HTTPS server certificate | ||
| │ ├── server.key # HTTPS server private key | ||
| │ ├── client.crt # mTLS client certificate | ||
| │ ├── client.key # mTLS client private key | ||
| │ └── server-ca.crt # eID-Server CA certificate (optional) | ||
| ├── .env.local | ||
| └── ... | ||
| ``` | ||
|
Comment on lines
+93
to
+103
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check the syntax here There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| ## Certificate Formats | ||
|
|
||
| ### Supported Formats | ||
|
|
||
| - **PEM format** (most common) | ||
| - **Base64 encoded** content | ||
| - **File paths** or direct content | ||
|
|
||
| ### Certificate Content Example | ||
|
|
||
| ```pem | ||
| -----BEGIN CERTIFICATE----- | ||
| MIIDtTCCAp2gAwIBAgIJAKg... | ||
| [Base64 encoded certificate] | ||
| -----END CERTIFICATE----- | ||
| ``` | ||
|
|
||
| ### Private Key Content Example | ||
|
|
||
| ```pem | ||
| -----BEGIN PRIVATE KEY----- | ||
| MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC... | ||
| [Base64 encoded private key] | ||
| -----END PRIVATE KEY----- | ||
| ``` | ||
|
|
||
| ## Common Certificate Issues | ||
|
|
||
| ### Self-Signed Certificate Warnings | ||
|
|
||
| **Issue**: Browser shows security warning | ||
| **Solution**: | ||
|
|
||
| - Development: Accept the certificate in browser | ||
| - Production: Use proper CA-signed certificates | ||
|
|
||
| ### Certificate Validation Errors | ||
|
|
||
| **Issue**: `UNABLE_TO_VERIFY_LEAF_SIGNATURE` or similar | ||
| **Solution**: | ||
|
|
||
| - Set `NODE_ENV=development` to accept self-signed certs | ||
| - Provide proper CA certificate in `EID_SERVER_CA_PATH` | ||
|
|
||
| ### mTLS Authentication Failures | ||
|
|
||
| **Issue**: eID-Server rejects client certificate | ||
| **Solution**: | ||
|
|
||
| - Verify certificate is signed by trusted CA | ||
| - Check certificate expiration | ||
| - Ensure private key matches certificate | ||
|
|
||
| ## Advanced Configuration | ||
|
|
||
| ### Custom Certificate Validation | ||
|
|
||
| ```javascript | ||
| // In SOAP client configuration | ||
| const tlsOptions = { | ||
| rejectUnauthorized: true, // Strict validation | ||
| ca: fs.readFileSync("./certs/trusted-ca.crt"), | ||
| checkServerIdentity: (host, cert) => { | ||
| // Custom validation logic | ||
| return undefined; // Accept connection | ||
| }, | ||
| }; | ||
| ``` | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Uh oh!
There was an error while loading. Please reload this page.