Notify the application when a user completes a sign-in - #61
Merged
Conversation
Add a service-to-service back-channel that posts a notification to the application whenever a signed-out user completes an interactive identity-provider login and a fresh session is established. - Fire from the shared provider callback (OnTicketReceived), so the notification is scoped to the genuine logged-out to signed-in transition and never fires on reused sessions or ordinary proxied requests. The credential-link flow still short-circuits first, so a link is never reported as a sign-in. - Derive an approximate location from the client IP (honoring X-Forwarded-For) and any geo headers a fronting CDN/proxy adds, with no heavy geo-IP dependency; parse the User-Agent into browser and OS with a lightweight built-in heuristic. - Configure the endpoint under Cratis:AuthProxy:SignIn:NotifyUrl, alongside the invite and link exchange URLs. Recording a sign-in is best-effort and never breaks the sign-in itself. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cover the notifier (posts subject, provider, IP, approximate location and parsed browser; skips when unconfigured; fails without a resolvable subject or on an endpoint error), the User-Agent parser, the client location resolver, and the service registration. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ication # Conflicts: # Source/AuthProxy/Authentication/AuthenticationServiceCollectionExtensions.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a service-to-service back-channel that notifies the application every time a user actually signs in — when a signed-out user completes an interactive identity-provider login and a fresh session is established. This is the AuthProxy half of Cratis/Studio#877; the application (Studio) records a sign-in event so users can later be notified of new sign-ins.
Added
POSTs{ subject, identityProvider, ipAddress, location, browser, operatingSystem, userAgent }to a configured application endpoint (Cratis/Studio#877).Cratis:AuthProxy:SignIn:NotifyUrl, alongside the existingInvite:ExchangeUrlandLink:ExchangeUrl. Leave it unset to disable notifications (Cratis/Studio#877).X-Forwarded-For) and any geo headers a fronting CDN/proxy adds (CF-IPCountry,X-Geo-*,X-AppEngine-*) — no heavy geo-IP dependency; when no geo headers are present only the IP travels (Cratis/Studio#877).User-Agentparsing into browser and operating system, with the raw header also forwarded (Cratis/Studio#877).Documentation/configuration/sign-in.md, wired into the configuration TOC (Cratis/Studio#877).Behavior notes
OnTicketReceived), so it is scoped to real sign-ins — never on reused sessions or ordinary proxied requests. The credential-link flow short-circuits before this point, so a link is never reported as a sign-in.Security
Deployment wiring (set
Cratis:AuthProxy:SignIn:NotifyUrlto the Studio Core internal endpoint) is a follow-up and is not part of this PR.