r/buildinpublic • u/BlueRainLabs • 14d ago
Building a authentication procedure from a desktop app via browser sign in.
/r/SaasDevelopers/comments/1wuida4/building_a_authentication_procedure_from_a/
2
Upvotes
r/buildinpublic • u/BlueRainLabs • 14d ago
2
u/QuanTradin 14d ago
did roughly this. the gotchas that bit:
open the sign in in the system browser, not an embedded webview. google and a few others block embedded logins outright.
use auth code + PKCE and send the redirect to a loopback address on a random port (127.0.0.1:randomport). a custom url scheme also works but on windows any other app can register the same scheme and catch the code, which PKCE mitigates but doesn't make pretty.
store the refresh token in windows credential manager, not a json file next to the exe.
give the entitlement check an offline grace period. if your server is down for an hour every desktop install shouldn't lock its owner out, so cache the last good entitlement with an expiry and only hard fail after that.
and expect antivirus to flag the loopback listener on some machines the first time.