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

Add OneLogin flow for Jobseekers #7019

Draft
wants to merge 88 commits into
base: one_login
Choose a base branch
from

Conversation

scruti
Copy link
Collaborator

@scruti scruti commented Aug 22, 2024

Trello card URL

Changes in this PR:

TLDR:

Builds a basic end-to-end integration for the Jobseeker using GovUK One Login and sets it up for testing on the Jobseeker's Sign-in button on the service front page.

Detailed:

  • Introduces a Jobseekers::GovukOneLogin namespace in our service.
  • Adds a Client that communicates with OneLogin endpoints.
  • Adds a service that, based on the OneLogin response, validates it and queries OneLogin user information.
  • Adds a controller to receive the redirections from One Login and set the user session.
  • Associate the OneLogin user info to an existing Jobseeker or create a new Jobseeker.
  • Add helper methods that allow users to be sent to Govuk OneLogin with a valid authorization request.
  • Change Jobseeker's Sign-in button in the service root page to test the flow-end-to-end.

Missing/next steps

  • Fix system tests or issues created for Publishers DFE-Sign-in flow
  • Build our OneLogin flows

This client will be used to retrieve the tokens and user info from One
Login.
For better namespacing and sharing domain code across the service.
@scruti scruti added the deploy label Aug 22, 2024
@scruti scruti changed the base branch from main to one_login August 22, 2024 12:03
@scruti scruti force-pushed the use-one-login-for-jobseekers branch 7 times, most recently from 3d33d38 to 7808986 Compare August 22, 2024 14:18
Copy link

Review app deployed to https://teaching-vacancies-review-pr-7019.test.teacherservices.cloud on AKS

Will contain the ID from OneLogin user associated with our local user
account.
We are setting up the basic end-to-end flow for a jobseeker to sign-in
into our service through GovUK One Login.

- Builds a OneLogin auth request to be redirected to from the
  Jobseeker's "Sign in" button in our TV front page.
- Creates a controller to receive the response from OneLogin for our
  auth requests, parse the response values and either:
  A) Redirect the user to the root page with an error message if
     the parsed response is an error or invalid.
  B) If a successfull response is sent, it attempts to retrieve the
     associated user info from OneLogin by getting a One Login token and
     using it to retrieve the user info endpoint. All of it using our
     OneLogin client.
- Attempts to insulate the OneLogin business/validation logic from the
  controller, leaving the controller for orchestrating the service
  retrieving OneLogin info, setting session values, setting the user and
  redirecting.
- This work is just an anemic basic flow to do and end-to-end sign-in
  through OneLogin. We need to build our full user flows from here.
The value is needed to initialise Rails during testing
Redirect existing users to account found page if it's their first log…
…rough-one-login

Sign-out Jobseekers through Govuk OneLogin
scruti and others added 2 commits October 3, 2024 16:53
…on-logout-through-one-login

Revert "Sign-out Jobseekers through Govuk OneLogin"
…r-jobseekers

* origin/one_login: (34 commits)
  Update DfE Analytics search_performed event
  filter sensitive controller parameters (#7124)
  Cache result of hitting Google places API to try and reduce the bill (#7129)
  Add flexi working section to Vacancy (#7115)
  Send email for saved jobs 10 days before expiry (#7079)
  tweaking more error messages
  Fix Fusion ATS organisation mapping
  Change test to reflect error message change
  Change error message for invalid email addresses
  Update tests after copy change on professional status page
  Bump the npm-dependencies group with 3 updates
  tweaking error message
  tweaking profile trn error message
  Update jobseekers_can_manage_a_profile_spec.rb
  Update jobseekers_can_add_professional_status_to_their_profile_spec.rb
  Update jobseekers_can_add_professional_status_to_their_job_application_spec.rb
  Update jobseeker_helpers.rb
  making teacher reference number lowercase
  adding TRN acronym
  TRN content tweaks
  ...
As it is listed in Analytics PII, we need to also exclude it from the
Rails parameter logging.
…ils-parameter-logging

Exclude the one login id from Rails param logging
KyleMacPherson and others added 6 commits October 4, 2024 13:10
The confirmation page after creating a job alert/subscription was
showing an old sign-in flow, requesting the password.

Fixed it by switching it to a One Login button/link and ensuring that
the users get redirected back to their job alerts dashboard (instead of
the Job applications dashboard) after they sign-in from this
confirmation page.
The banner displaying "You need to log in or create an account..." when
an unsigned user attempts to save a vacancy or apply through a quick
apply vacancy contained a link to the old in-house user registration
flow.

Removing the link as we now manage registrations through GovUK One
Login.
KyleMacPherson and others added 2 commits October 4, 2024 15:06
…sfer page when they enter the incorrect confirmation code
…ting-subscriptions

Fix login prompt after creating a subscription
@scruti scruti changed the title Add basic OneLogin flow for Jobseekers Add OneLogin flow for Jobseekers Oct 4, 2024
Small content tweaks to one login flow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants