Skip to content

Add -D device code flow to connect-safeguard.sh - #104

Merged
petrsnd merged 9 commits into
OneIdentity:mainfrom
petrsnd:feature/device-code
Jun 3, 2026
Merged

petrsnd merged 9 commits into
OneIdentity:mainfrom
petrsnd:feature/device-code

Conversation

@petrsnd

@petrsnd petrsnd commented Jun 3, 2026

Copy link
Copy Markdown
Member

Adds -D to connect-safeguard.sh for OAuth 2.0 Device Authorization
Grant (RFC 8628) login. Useful for headless environments (Docker, SSH,
CI) where a local browser cannot be launched. Mirrors -DeviceCode from
safeguard-ps#630.

Optional -i <provider> is treated as a hint and appended to the
verification URLs so the rSTS skips the provider drop-down. Incompatible
with -P, -i certificate, and -c/-k. All prose goes to stderr so
-X keeps stdout clean for piping. Login file gets a DeviceCode=true
marker for parity with Pkce=true.

Requires Safeguard 7.4+ with the Device Code OAuth2 grant enabled
(Appliance Management → Safeguard Access → Local Login Control).

Manually tested against a live appliance: drop-down and provider-hinted
flows, grant-disabled HTML error path, Ctrl+C, code expiration, -X
stdout discipline, all four incompatible-flag rejections, and the sed
fallback path (no jq on PATH).

@petrsnd
petrsnd requested a review from a team as a code owner June 3, 2026 18:24
@petrsnd
petrsnd merged commit 388d79a into OneIdentity:main Jun 3, 2026
2 checks passed
@petrsnd
petrsnd deleted the feature/device-code branch June 3, 2026 18:43
@petrsnd

petrsnd commented Jun 3, 2026

Copy link
Copy Markdown
Member Author

A customer recently asked me for a headless solution (no browser) to use safeguard-bash. This is the solution.

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