Altinn / Altinn/app-lib-dotnet

Implement AuthenticationMethod support in `IInstanceClient`

Open
#1,498 1 comment 0 reactions 2 assignees Assigned to @martinothamar View on GitHub
good-first-issue squad/kjøring
Dominant language
C#
Stars
8
Forks
27
Avg merge
1h 21m
Merged PRs (30d)
7

Description

## Description
[`IDataClient` recently implemented a new optional authentication override](https://github.com/Altinn/app-lib-dotnet/pull/1425).

This same methodology should be implemented in `IInstanceClient`.

## Tasks
- [x] Add optional `StorageAuthenticationMethod` and `CancellationToken` parameters to all applicable methods on `IInstanceClient`
- [x] Default/undefined usage should resolve to `StorageAuthenticationMethod.CurrentUser`
- [x] Inject `IAuthenticationTokenResolver` and use this for JwtToken resolution ([example](https://github.com/Altinn/app-lib-dotnet/pull/1425/files#diff-faf65e5c88ef85660768341399b8faa5ca3a17ce0cd3b8f68d23c6d16331609bR93-R96))
- [ ] Update unit tests to observe that correct tokens are used in the various scenarios. This can be a bit tedious, and borrowin inspiration from the [DataClientTests](https://github.com/Altinn/app-lib-dotnet/pull/1425/files#diff-54b34e469032c05e41b6a635782d75e129449196ad9e6a8f33ed40031285e110) may be helpful

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.