Closed danielskovli closed 1 month ago
Note to self: DelegatingHandler
-> https://stackoverflow.com/a/61410855/9589714
We should probably look into existing applications using Maskinporten ensuring we have one consistent way moving forward. In App.Core we have used a package Altinn.ApliClients.Maskinporten and we should make a decision whether we use this or not. And if not we should deprecated it and remove it i V9.
In App.Core we have used a package Altinn.ApliClients.Maskinporten and we should make a decision whether we use this or not.
Without being able to absolutely confirm this, the team has indicated on multiple occasions that owning the Maskinporten integration completely and absorbing the relevant code into Altinn.App.Core is preferred.
WIP project at https://github.com/danielskovli/maskinporten-authentication-dotnet
To become a PR with app-lib-dotnet once most of the creases are ironed out.
Implementation: https://github.com/Altinn/app-lib-dotnet/pull/669
Description
In relation to #492, app-lib-dotnet needs to expose an
IMaskinportenClient
interface along with an implementation.Assuming that the app developer has configured the required Maskinporten scopes via Altinn Studio (publish page), the app should be able to receive an
IMaskinportenClient
instance at runtime. This instance will handle Maskinporten authentication and expose a.GetAccessToken
method or simila; for use withHttpClient
calls to protected APIs.Additional Information
Should we also expose a factory method that returns a pre-authenticated
HttpClient
instance? If so, considerIHttpClientFactory
[1, 2]