Urgent.News

What's breaking now, across thousands of outlets.

Tech

Patient Portal OAuth Login: Explicit Consent and Refresh Token Rotation in Node.js

OAuth makes a patient portal login feel familiar, but it does not answer the hard question: should this application read a particular category of health data right now? My recommendation is to keep identity, consent, and session lifetime as separate decisions. Pick a managed provider when its policy controls and recovery workflow match your risk model; pick a programmable option when you need…

When using OAuth to log into a patient portal, it's important to remember that the system should not automatically grant access to specific categories of health data. The developer must keep the decisions about identity, consent, and session lifetime separate. If a highly controlled environment is needed, a programmable solution may be preferable to a managed provider.

When a user logs in through an OAuth callback, the first step is to show them the specific data category they are about to access, along with the purpose and action that will trigger the read. For instance, instead of saying "improve your experience," the system should explain "Medication history, used to pre-fill the refill form when you open it."

After establishing a local account, the system must verify the current consent state before accessing any protected data. This can be a granted, revoked, or absent state, and the UI must reflect that state even if the user has left the browser tab open. If a user revokes consent, any subsequent API call attempting to process data should not be allowed. The audit record should capture the state transition, the category, actor, timestamp, and request identifier.

When implementing refresh token rotation, the system should issue a new refresh token upon refresh and invalidate the previous one. The session should also be revoked if there's suspicion of a replay or stolen device. Old tokens should never appear in logs. In a small Node.js control path, the code checks consent before a data read and provides an explicit session revoke path. It uses only documented auth routes and handles retries according to the Retry-After header, without silently retrying other failures.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

I Stopped Managing Servers Manually — Understanding Docker, Amazon ECR, ECS & Fargate

I Stopped Managing Servers Manually — Understanding Docker, Amazon ECR, ECS & Fargate I had already learned how a web application can be built on AWS using EC2, Load Balancers, Auto Scaling, RDS, S3…

  • Developers created Docker images using Dockerfiles.
  • Images stored in Amazon ECR for container management.
  • AWS Fargate managed underlying infrastructure for ECS.

Cost-Effective Public Hosting for Typescript/MySQL Monorepo: Optimizing for Small User Base Without Unnecessary Expenses

Introduction Hosting a Typescript/MySQL monorepo application for a small user base (4-5 users) presents a unique challenge: balancing cost-effectiveness with tech stack compatibility .

  • Oracle Cloud's Always Free Tier is optimal for small Typescript/MySQL monorepo
  • Supports Docker containers and managed MySQL database without domain purchase
  • Monitors resource usage to avoid surpassing free tier limits

More from Tuesday 15 September →