Skip to content

Added Login with otp - #1095

Merged
veenupunyani merged 2 commits into
developfrom
sign-in-with-email-OTP
Jul 23, 2026
Merged

Added Login with otp#1095
veenupunyani merged 2 commits into
developfrom
sign-in-with-email-OTP

Conversation

@veenupunyani

Copy link
Copy Markdown
Collaborator

Summary

  • Added Email OTP as a second sign-in option beside BC Services Card on the booking login step (OTP | OR | BCSC, plus learn-more links).
  • Allowed Keycloak IdP hint otp in the booking allow-list; reused the same SPA client / OAuth callback path as BCSC.
  • Hardened the return path: browser-back guard on /signin/:idpHint, prompt: 'login',
  • Hardcoded gov.bc.ca learn-more URLs and removed BC_SERVICES_CARD_URL from runtime config.

Test plan

  • Temporary config (OTP only): edit appointment-booking/public/config/kc/keycloak-public.json to point at dev Keycloak
{
  "realm": "servicebc",
  "auth-server-url": "https://dev.loginproxy.gov.bc.ca/auth/",
}

Keep rest env vars same

  • Restart the app if required . Prefer a personal email for OTP (@gov.bc.ca / IDIR linking took some time for me to link but it did worked at the end after it was linked to same account).
  • Select a service + location, open login → OTP and BCSC buttons, OR separator, and both learn-more links show
  • Complete Login with Email OTP with a real inbox → return signed in on /login
  • From Keycloak, use browser Back → returns to /login without looping into Keycloak
  • Learn-more links open the BCSC and one-time passcode gov pages in a new tab

Added email OTP as an alternate Keycloak sign-in option

Offered OTP alongside BC Services Card on the login step, allowed the otp IdP,
and hardened the OAuth return path (back-button guard, prompt=login).
Hardcoded learn-more links and dropped BC_SERVICES_CARD_URL from runtime config.
@veenupunyani veenupunyani changed the title Sdded Login with otp Added Login with otp Jul 23, 2026

@chrsamp chrsamp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @veenupunyani, nice work! Unfortunately, I hit a blocker during some testing, can you please take a look at the comment in my review and see if you can resolve it?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When attempting to authenticate, if I click the browser's back button and return to the application, I am unable to authenticate again via any IdP.

Steps to reproduce:

  • Go to https://dev-appointments.apps.silver.devops.gov.bc.ca/
  • Choose a service and location
  • Attempt to sign in with OTP
  • When prompted for an email, click the browser's back button
  • See "Signing you in..." message on the screen, nothing else
  • Go back again (to choose a location), select a location, click Continue
  • Attempt to sign in with any IdP
  • See the "Signing you in..." message again, no redirect to Keycloak

What should happen:

  • User clicks back from Keycloak and returns to the login page with IdP options
  • User can re-attempt using any available IdP

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, fixed.

@sonarqubecloud

Copy link
Copy Markdown

@veenupunyani
veenupunyani requested a review from chrsamp July 23, 2026 21:27

@chrsamp chrsamp left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you @veenupunyani. Latest commit fixes the bug.

@veenupunyani
veenupunyani merged commit 0d5b6ff into develop Jul 23, 2026
3 checks passed
@veenupunyani
veenupunyani deleted the sign-in-with-email-OTP branch July 23, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants