Skip to content

2. Identity Provider

Antonio Calatayud edited this page Jun 17, 2020 · 7 revisions

Identity Provider

The Identity Provider (IDP) is one of the key components of the solution. Has been built using .Net Core.

Docker Container Configuration

It is important to clarify that are many different ways to configure the ipmdecisions/identityproviderservice image when building it. Depending on the needs during the deployment, you might choose one.

When .Net Core applications are loaded, they use default configuration files: appsettings.json or/and appsettings.{Environment}.json. See in the repository the file that is included inside the docker image. As expected, the default configuration is very generic.

Finally, when deploying using docker-compose, you can also add environmental variables. These variables will override the appsettings.json ones.

Database

This microservice needs a MySQL database to run. The database will run on its own container. To create the database structure and add default data, an SQL script has been created. It is located on the repository. This script can be run the first time the database container is created adding in it on the volumes section of the docker-compose. Also, you can do a backup of an existing database and applied to MySQL instance.

Variables

Name Possible Values Description Notes
ASPNETCORE_ENVIRONMENT Development/Staging/Production Set the application environment Production enforces HTTPS, so only use when certificates installed
ASPNETCORE_URLS http://+:80 Sets entry port of the solution. Must match docker ports Use https://+:443;http://+:80 when valid HTTPS certificates installed
ASPNETCORE_HTTPS_PORT 443 Enforces HHTPS entry port Use when valid HTTPS certificates installed
ASPNETCORE_Kestrel__Certificates__Default__Path /https/YourCertificate.pfx Internal path to your HTTPS certificate Use when valid HTTPS certificates installed
ASPNETCORE_Kestrel__Certificates__Default__Password abc1234 Password of your internal HTTPS certificate Use when valid HTTPS certificates installed

Database

Volumes

If you prefer to change load your own appsettings.json, you can achieve this by mounting them using docker-compose volumes. Bellow is the location inside the container where you should copy the files:

volumes:
   - ./your/localPath/appsettings.json:/app/appsettings.json
   - ./your/localPath/appsettings.Development.json:/app/appsettings.Development.json

Docker Compose section from the APG

Below is an example of the Identity Provider and its database section in the docker-compose file:

Clone this wiki locally