Enable PKCE extension in GDS OmniAuth Strategy #283
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.
https://trello.com/c/59EBweBx
In alphagov/signon#2312 we enabled the OAuth2 PKCE extension in Signon.
In this PR we update the GDS OAuth2 OmniAuth Strategy to make use of the PKCE extension. This means that any of our apps using this Gem will benefit from the additional protection offered by the PKCE extension.
Testing this change in development
Create an app in Signon representing Whitehall Publisher.
Give our test user permission to access Whitehall Publisher.
Set the following environment variables for the whitehall-app container in govuk-docker/projects/whitehall/docker-compose.yml, where
<oauth-id>
isapp.uid
and<oauth-secret>
isapp.secret
.Modify Whitehall's Gemfile and install Gems:
Now when you sign in to Signon and access Whitehall Publisher in development you'll be able to see the following PKCE related params in the Signon logs:
code_challenge
andcode_challenge_method
in the querystringcode_verifier
in the POSTed body