What is this auth feature called and how do I do this?

When I am in a desktop app and need to authenticate myself, the browser opens with an auth page and when I added my credentials successfully/logged in through oAuth, I am also authed in the desktop app. I have a web app with nextAuth and I want to auth people through that when they want to log into my desktop app. Examples if you don't know what I am talking about: Logging into github through vscode(for vscode setting sync), figma also does this(this is the link that opens: https://www.figma.com/app_auth/id/grant?desktop_protocol=figma&locale=en)
11 Replies
Neto
Neto3y ago
oauth oauth2 to be exact
Johnson
JohnsonOP3y ago
>mind blown so like, I need to allow my web app to act as an oauth service (which is using other oauth services itself) (like github/discord)
Neto
Neto3y ago
no if you are using oauth as a authentication mechanism most of time you use a adapter on the service to manage the user like
Neto
Neto3y ago
GitHub
GitHub - fastify/fastify-oauth2: Enable to perform login using oaut...
Enable to perform login using oauth2 protocol. Contribute to fastify/fastify-oauth2 development by creating an account on GitHub.
Neto
Neto3y ago
the external service, suck as github, "validate" the user and return a token for you to check the user and stuff they hold the main user info
Johnson
JohnsonOP3y ago
I understand that oauth allows me to authenticate users through other apps, when I do that, I store a session id on my database. That will be the same session id that the user stores inside a cookie on the webpage. But here is my problem: If my desktop app has a 'Log in through browser' button, how do I get that session id(the cookie) to the desktop app, once the sign in is complete because right now, if I just linked the 'Log in through browser' button with mywebsite.com/signIn, I wound just sign into my website as if the desktop app would not exist
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Johnson
JohnsonOP3y ago
ye so to elaborate on that a little to make sure we are on the same page: 1. is after the auth was a success 2. will be the typical prompt that wants to open a desktop app right?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Johnson
JohnsonOP3y ago
I will keep you updated when I make more progress with this then
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server