generated from communitiesuk/funding-service-design-TEMPLATE
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build JWT directly rather than (ab)use auth magic links
We are switching from, really, one hack to another here, in order to be able to run these tests against and in the dev/test environments. Currently/previously, we used the magic links flow on authenticator to get a logged-in session, but this only worked easily for accounts that don't need any roles. To give them roles, we need to hit the account store API directly to inject them. The account store API is internal (not accessible over the public Internet) in dev/test environments, so we would need to do some janky stuff to get access to it from eg local machines and/or github actions. Our current auth flow just ends up setting a cookie in the browser that works across all FS domains and doesn't ever "call home" to verify the details. So if we can just build a matching cookie and inject it into the browser, those details will be accepted outright. We need to sign it with a private key that the apps will trust, so we now need to read that key appropriately for the dev/test environments. Then just build the JSON blob, sign it, and stick it in the browser.
- Loading branch information
1 parent
50c698d
commit f007080
Showing
4 changed files
with
104 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters