This is an API application that uses the OIDC provider
with OAuth2.0Introspection
to authenticate a user with an opaque access token
from the provider.
The API does support exactly one call: <HOST>/swapi/people
,
which calls the Star Wars API and returns the
first ten people in the result.
OIDC Introspection is defined in RFC7662
and allows an API to accept opaque access tokens
. Some systems (dotnet as well)
can validate JWT
tokens out of the box but do not support introspection.
To configure the API, you can use the following environment variables (note the double underscores _
which is the default delimiter for objects in dotnet environment variables):
PORT
: The port that the API runs on (Default5000
).OIDC__ISSUER
: Configure the issuer (most likely the host url of the OIDC provider).OIDC__CLIENTID
: The client id for OIDC authentication.OIDC__CLIENTSECRET
: Client secret for OIDC authentication.
To use the OIDC API, you may:
- Clone the repo and build the Docker image by yourself.
- Copy paste the parts that you need from the docker-compose file.
- Use the published Docker image from github in your docker compose file, as shown in the example.