fix: Fix iss claim in dialog token #1047
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This fixes the
iss
claim getting either two slashes or no slashes after the base uri part, due someUri
ToString() behaviour I do not fully understand.Before this fix, tokens made on test (any other environment than localdev) missed a slash resulting in
iss
claim beinghttps://altinn-dev-api.azure-api.net/dialogportenapi/v1
. This was due to the call toGetDialogToken
missing a leading slash. However, this resulted in double slashes when running locally, iehttps://localhost:7247//api/v1
. Both configurations are defined withBaseUri
values without trailing slashes.The fix consists of adding a leading slash to the
GetDialogToken
call, and trimming any trailing slash from theBaseUri
when concatenating inDialogGenerator
Related Issue(s)
Verification