Skip to content

Add Device Code (RFC 8628) authentication#42

Merged
petrsnd merged 6 commits into
OneIdentity:mainfrom
petrsnd:feature/device-code-login
Jul 1, 2026
Merged

Add Device Code (RFC 8628) authentication#42
petrsnd merged 6 commits into
OneIdentity:mainfrom
petrsnd:feature/device-code-login

Conversation

@petrsnd

@petrsnd petrsnd commented Jun 30, 2026

Copy link
Copy Markdown
Member

Adds OAuth 2.0 Device Authorization Grant (RFC 8628) login support.

What''s included

  • device-code authentication strategy exported from the auth, root, and browser entry points.
  • Caller-supplied callback for presenting the verification URL and user code — no library display I/O, no browser spawning.
  • Node and bundled browser samples; README documentation.

Tests

  • 11 new device-code unit tests (153 unit total); typecheck and build clean.
  • Live integration test green.

Package version is derived from git tags and is intentionally not hand-edited.

petrsnd added 5 commits June 30, 2026 14:16
Implements the OAuth 2.0 Device Authorization Grant as a platform-agnostic auth strategy exported from both the Node and browser entry points. Requests a device code, hands public verification details to a required onDeviceCode callback, polls the token endpoint with AbortSignal support, and exchanges the rSTS token for a Safeguard user token.
Covers disabled-grant detection, poll-loop interval transitions, access_denied/expired_token/deadline outcomes, AbortSignal cancellation, the rSTS token exchange, and the onDeviceCode callback contract using a mock HttpClient.
Saves and restores the appliance's Allowed OAuth2 Grant Types, asserts the disabled-grant ConfigurationError, and asserts the enabled path delivers a verification URL and user code. Auto-skips without SPP_HOST.
Adds Device Code to the auth strategies list and a Node + browser usage section describing the headless display-and-poll flow, the appliance grant prerequisite, and AbortSignal cancellation.
Node sample prints the verification URL and code from onDeviceCode; bundled browser sample renders them in the DOM. Updates the samples index.
@petrsnd
petrsnd requested a review from a team as a code owner June 30, 2026 21:58
New device-code functionality warrants a minor bump. Also clarify the versioning note: package.json holds the prerelease base; v* tags own stable releases.
@petrsnd
petrsnd merged commit 2514a54 into OneIdentity:main Jul 1, 2026
4 checks passed
@petrsnd
petrsnd deleted the feature/device-code-login branch July 1, 2026 00:48
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.

1 participant