Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

Latest commit

 

History

History

oidc_api

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

OIDC API

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.

Configuration

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 (Default 5000).
  • 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.

Deployment

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.