Skip to content

Altinn platform microservice for handling user profile

Notifications You must be signed in to change notification settings

Altinn/altinn-profile

Repository files navigation

Altinn Profile

Build status

Profile build status

Project organization

This is a backend WebAPI solution written in .NET / C# following the clean architecture principles.

Altinn.Profile

The API layer that consumes services provided by Altinn.Profile.Core

Relevant implementations:

  • Controllers
  • Program.cs

Altinn.Profile.Core

The domain and application layer that implements the business logic of the system.

Relevant implementations:

  • Interfaces for external dependencies implemented by infrastructure and repository layer
  • Domain models
  • Services

Altinn.Profile.Integrations

The infrastructure layer that implements the interfaces defined in Altinn.Profile.Core for integrations towards 3rd-party libraries and systems.

Relevant implementations:

  • Clients for communicating with SBL Bridge in Altinn 2
  • Database for KRR-data
  • Client for communicating with KRR to update the local DB

Getting Started

These instructions will get you a copy of the profile component up and running on your machine for development and testing purposes.

Prerequisites

  1. .NET 9.0 SDK
  2. Newest Git
  3. A code editor - we like Visual Studio Code
  4. Podman or another container tool such as Docker Desktop
  5. PostgreSQL
  6. pgAdmin

Setting up PostgreSQL

Ensure that both PostgreSQL and pgAdmin have been installed and start pgAdmin.

In pgAdmin

  • Create database profiledb
  • Create the following users with password: Password (see privileges in parentheses)
    • platform_profile_admin (superuser, canlogin)
    • platform_profile (canlogin)

A more detailed description of the database setup is available in our developer handbook

Cloning the application

Clone Altinn Profile repo and navigate to the folder.

git clone https://github.com/Altinn/altinn-profile
cd altinn-profile

Running the application in a docker container

  • Start Altinn Profile docker container by running the command
podman compose up -d --build
  • To stop the container running Altinn Profile run the command
podman stop altinn-platform-profile

Running the application with .NET

The Profile components can be run locally when developing/debugging. Follow the install steps above if this has not already been done.

  • Navigate to _src/Altinn.Profile, and build and run the code from there, or run the solution using you selected code editor
cd src/Altinn.Profile
dotnet run

The profile solution is now available locally at http://localhost:5030/. To access swagger use http://localhost:5030/swagger.

Populate the Profile DB with KRR data

  1. Set up required user secrets for Maskinporten integration in the ASP.NET Core Secret Manager, e.g. via CLI by running the following commands from src/Altinn.Profile
dotnet user-secrets set "ContactAndReservationSettings:MaskinportenSettings:ClientId" "{SECRET_GOES_HERE}"
dotnet user-secrets set "ContactAndReservationSettings:MaskinportenSettings:EncodedJwk" "{SECRET_GOES_HERE}"
  1. Run the application, and send the following request (e.g. using Postman) to initiate the synchronization job:
    GET http://localhost:5030/profile/api/v1/trigger/syncpersonchanges

About

Altinn platform microservice for handling user profile

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages