Sign inSign up

jonasprimbs/oidc-e2ea-server

By jonasprimbs

•Updated 5 months ago

An extension to OpenID Providers for End-to-End Authentication

Image
0

2.0K

jonasprimbs/oidc-e2ea-server repository overview

⁠OpenID Connect End-to-End Authentication Extension

This project containerizes an extension for OpenID Providers to provide an endpoint to request a Remote ID Token (RIDT) for end-to-end authentication with OpenID Connect. For further details, visit the application's repository (external URL)⁠ or the standard's draft repository (external URL)⁠ on GitHub.

⁠Tags Overview

  • 0, 0.1, 0.1.0, latest

⁠Quick Start

To run the container, use the following command:

$ docker run --name ridt -v <private-key-file>:/config/private_key.pem -e KEY_FILE=/config/private_key.pem -e KID="<op-key-id>" -e ALG=<op-key-alg> -e USERINFO=<op-userinfo-url> -e ISSUER=<op-issuer> jonasprimbs/oidc-e2ea-server:latest

Adjust the parameters as follows:

  • <private-key-file>: Path to the private key file of the OpenID Provider, e.g., /path/to/private_key.pem.
  • <op-key-id>: The Key ID of your private key in the OpenID Provider, e.g., rojPQoDRx_DD-DFs7y45wDLl5T8b9VmX6iQapIK6cRE.
  • <op-key-alg>: The signing algorithm of your OpenID Provider. This depends on your private key, e.g., ES256 for an EC private key, or RS256 for an RSA private key.
  • <op-userinfo-url>: The URL from the container to the userinfo endpoint of your OpenID Provider, e.g., http://localhost:8080/realms/ridt/protocol/openid-connect/userinfo.
  • <op-issuer>: The root URL for your OpenID Provider, e.g., https://accounts.sample.org/realms/ridt.

Example:

$ docker run --name ridt -v /path/to/private_key.pem:/config/private_key.pem -e KEY_FILE=/config/private_key.pem -e KID="rojPQoDRx_DD-DFs7y45wDLl5T8b9VmX6iQapIK6cRE" -e ALG=RS256 -e USERINFO=http://localhost:8080/realms/ridt/protocol/openid-connect/userinfo -e ISSUER=https://accounts.sample.org/realms/ridt jonasprimbs/oidc-e2ea-server:latest

⁠Configuration

This section describes the configuration parameters of the ICT Endpoint. They are applied by injecting them as environment variables to the running application. This can be done by defining the variables in the Docker container or by placing an .env file in the execution directory.

⁠Key File

Absolute or relative file path to the OpenID Provider's private key file in PEM format.

Example:

KEY_FILE="/path/to/private_key.pem"

Setting this variable is required.

⁠Key ID

The ID of the OpenID Provider's Public Key provided in the jwks_uri endpoint.

Example 1:

KID="rojPQoDRx_DD-DFs7y45wDLl5T8b9VmX6iQapIK6cRE"

Example 2:

KID=1

Setting this variable is required.

⁠Signing Algorithm

Signing algorithm for Identity Certification Token signatures.

Allowed values are:

  • RS256 for RSASSA-PKCS1-v1_5 using SHA-256
  • RS384 for RSASSA-PKCS1-v1_5 using SHA-384
  • RS512 for RSASSA-PKCS1-v1_5 using SHA-512
  • ES256 for ECDSA using P-256 and SHA-256 (recommended)
  • ES384 for ECDSA using P-384 and SHA-384
  • ES512 for ECDSA using P-521 and SHA-512
  • EdDSA for Eduard Digital Signing Algorithm using Ed25519 curve

Default Value: ES256.

Example:

ALG="ES256"
⁠Userinfo Endpoint

Absolute URI to the OpenID Provider's Userinfo Endpoint.

This URI is used by the ICT Endpoint to request the claims of the Identity Certification Token from the OpenID Provider. Make sure that the running ICT Endpoint can access the OpenID Provider's Userinfo Endpoint via this URI!

Example 1:

USERINFO="https://openid-provider.sample.org/userinfo"

Example 2 (Keycloak):

USERINFO="http://localhost:8080/realms/ict/protocol/openid-connect/userinfo"

Setting this variable is required.

⁠Token Introspection Endpoint

Absolute URI to the OpenID Provider's Token Introspection Endpoint described in RFC 7662⁠. This URI is provided on the Discovery Endpoint as attribute introspection_endpoint. Make sure that the running ICT Endpoint can access the OpenID Provider's Token Introspection Endpoint via this URI!

Example 1:

TOKEN_INTROSPECTION="https://openid-provider.sample.org/introspect"

Example 2 (Keycloak):

TOKEN_INTROSPECTION="http://localhost:8080/realms/ict/protocol/openid-connect/token/introspect"

Setting this variable is required.

⁠Token Introspection Host

The hostname in HTTP Host Header when requesting the Token Introspection Endpoint. If not provided, the hostname from the TOKEN_INTROSPECTION URL will be used.

Example:

TOKEN_INTROSPECTION_HOST="openid-provider.sample.org
⁠Token Introspection Credentials

The HTTP Authorization Header required for the Token Introspection Endpoint. Typically a HTTP Basic Authentication Header using the ICT Endpoint's Client Credentials.

Example:

INTROSPECTION_CREDENTIALS="Basic aWN0X2VuZHBvaW50OlMzY3JldCE="

For Client ID ict_endpoint and Client Secret S3cret!

Setting this variable is required, except the OpenID Provider does not requires any authorization for the Token Introspection Endpoint (not recommended).

⁠Context Prefix

Prefix of scopes which indicate the granted end-to-end authentication context.

Default Value: e2e_ctx_.

Example:

CONTEXT_PREFIX="ctx_"

The scope ctx_email will authorize the End-User for the email context.

⁠Issuer Claim

The Identity Certification Token's Issuer.

This is the value of the iss claim of the issued Identity Certification Token. Typically, this is the public URI of the OpenID Provider where .well-known/openid-configuration is added to request the OpenID configuration.

Example 1:

ISSUER="https://accounts.sample.org/"

Example 2:

ISSUER="http://localhost:8080/realms/ict"

Setting this variable is required.

⁠Token Validity Period

The Identity Certification Token's default validity period in seconds.

Default Value: 3600 (1 hour).

Example:

DEFAULT_TOKEN_PERIOD=3600
⁠Maximum Token Validity Period

The Identity Certification Token's maximum validity period in seconds. If the requested token period is longer than this value, this value is used.

Default Value: 2592000 (30 days).

Example:

MAX_TOKEN_PERIOD=2592000
⁠Port

The Port where the endpoint is running on.

Default Value: 8080.

Example:

PORT=8080
⁠Database File

The SQLite database file to store used nonce values in.

Default Value (standalone): ./db.sqlite
Default Value (Docker image): /config/db.sqlite

Example:

DB_SQLITE_FILE="/config/db.sqlite"

Tag summary

Content type

Image

Digest

sha256:217858aa4…

Size

8.3 MB

Last updated

almost 3 years ago

docker pull jonasprimbs/oidc-e2ea-server