[MOCK] OAuth Server

2 minutes read
Edit on GitHub

OAuth2.0 Mock Server used for automated tests, bundle container and optionally deployment using the HELM chart for the development purposes.

SOURCE Copy
Copied
        docker pull ghcr.io/plgd-dev/hub/mock-oauth-server:latest
    

A configuration template is available on test/oauth-server/config.yaml.

PropertyTypeDescriptionDefault
log.levelstringLogging enabled from level."info"
log.encodingstringLogging format. The supported values are: "json", "console""json"
log.stacktrace.enabledboolLog stacktrace.false
log.stacktrace.levelstringStacktrace from level."warn"
log.encoderConfig.timeEncoderstringTime format for logs. The supported values are: "rfc3339nano", "rfc3339"."rfc3339nano"

HTTP API of the OAuth Server service as defined here

PropertyTypeDescriptionDefault
apis.http.addressstringListen specification <host>:<port> for http client connection."0.0.0.0:9100"
apis.http.readTimeoutstringThe maximum duration for reading the entire request, including the body by the server. A zero or negative value means there will be no timeout.8s
apis.http.readHeaderTimeoutstringThe amount of time allowed to read request headers by the server. If readHeaderTimeout is zero, the value of readTimeout is used. If both are zero, there is no timeout.4s
apis.http.writeTimeoutstringThe maximum duration before the server times out writing of the response. A zero or negative value means there will be no timeout.16s
apis.http.idleTimeoutstringThe maximum amount of time the server waits for the next request when keep-alives are enabled. If idleTimeout is zero, the value of readTimeout is used. If both are zero, there is no timeout.30s
apis.http.tls.caPool[]stringFile paths to the root certificates in PEM format. The file may contain multiple certificates.[]
apis.http.tls.keyFilestringFile path to private key in PEM format.""
apis.http.tls.certFilestringFile path to certificate in PEM format.""
apis.http.tls.clientCertificateRequiredboolIf true, require client certificate.true

Signer configuration to issue ID/access tokens of OAuth provider for mock testing.

PropertyTypeDescriptionDefault
oauthSigner.idTokenKeyFilestringFile path to a private RSA key in PEM format required for ID token signing.""
oauthSigner.accessTokenKeyFilestringFile path to a private ECDSA key in PEM format required for access token signing.""
oauthSigner.domainstringDomain address <host>:<port> for OAuth APIs.""
oauthSigner.clients[0].idstringclient id which is used by oauth clients."test"
oauthSigner.clients[0].authorizationCodeLifetimestringvalidity of generated authorization code"10m0s"
oauthSigner.clients[0].accessTokenLifetimestringvalidity of generated access token lifetime. 0s means forever."0s"
oauthSigner.clients[0].codeRestrictionLifetimestringdefine period how long cannot be used again authorization code in exchange after first use."0s"
Note

Note that the string type related to time (i.e. timeout, idleConnTimeout, expirationTime) is decimal numbers, each with optional fraction and a unit suffix, such as “300ms”, “1.5h” or “2h45m”. Valid time units are “ns”, “us”, “ms”, “s”, “m”, “h”.

Oct 1, 2021

Get started

plgd makes it simpler to build a successful IoT initiative – to create a proof of concept, evaluate, optimize, and scale.

Get Started Illustration Get Started Illustration