Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix iss claim in dialog token #1047

Merged
merged 3 commits into from
Aug 26, 2024
Merged

Conversation

elsand
Copy link
Collaborator

@elsand elsand commented Aug 24, 2024

Description

This fixes the iss claim getting either two slashes or no slashes after the base uri part, due some Uri 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 being https://altinn-dev-api.azure-api.net/dialogportenapi/v1. This was due to the call to GetDialogToken missing a leading slash. However, this resulted in double slashes when running locally, ie https://localhost:7247//api/v1. Both configurations are defined with BaseUri values without trailing slashes.

The fix consists of adding a leading slash to the GetDialogToken call, and trimming any trailing slash from the BaseUri when concatenating in DialogGenerator

Related Issue(s)

  • N/A

Verification

  • Your code builds clean without any errors or warnings
  • Manual testing done (required)
  • Relevant automated test added

@elsand elsand requested a review from a team as a code owner August 24, 2024 10:51
Copy link

@elsand elsand merged commit 9ab4a85 into main Aug 26, 2024
18 checks passed
@elsand elsand deleted the fix/missing-slash-from-iss-claim branch August 26, 2024 13:31
oskogstad pushed a commit that referenced this pull request Sep 4, 2024
🤖 I have created a release *beep* *boop*
---


##
[1.16.0](v1.15.0...v1.16.0)
(2024-09-04)


### Features

* **webapi:** Require legacy scope for HTML support
([#1073](#1073))
([03237cc](03237cc))
* **webAPI:** Require UUIDv7
([#1032](#1032))
([e9b844f](e9b844f))


### Bug Fixes

* Fix iss claim in dialog token
([#1047](#1047))
([9ab4a85](9ab4a85))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
elsand added a commit that referenced this pull request Sep 17, 2024
…adata (#1145)

## Description

This is the same issue as fixed for the `iss` claim in #1047 (trailing
slash behaviour differs when BaseUri is localhost). Root cause not yet
determined, but this functions as a workaround.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants