Note down the generated client_id, client_secret (if applicable), and the baseurl of your auth instance.
π Option 1: Browser-Based Authorization Flow
In this method, your desktop app opens the Skillmine Auth login page in the user's default browser and handles the authentication callback.
π Step 1: Generate Authorization URL
Build an authorization URL using the following structure:
π Replace placeholders:
client_id: From Skillmine Auth admin portal
redirect_uri: URL your app listens to for the redirect (can be a custom scheme like myapp://callback for native apps)
π₯οΈ Step 2: Open in Browser
When your desktop app launches and no session is active:
Open the authorization URL in the user's browser.
After successful login, the user will be redirected to your appβs redirect URI with either an access_token or an authorization code.
π Step 3: Token Handling
If you use response_type=code, exchange the code for a token by calling the Token API.
If you use response_type=token, the token will be returned directly in the redirect URL.
π Step 4: Session Maintenance
Periodically call the Introspection API to check token validity.
On logout, call the Logout API to properly terminate the session.
π Well-Known Endpoint
Fetch available endpoints (token URL, logout URL, etc.):
This JSON provides all the necessary URLs for token exchange, introspection, and logout.
π₯οΈ Option 2: Device Authorization Flow
This flow is ideal for native desktop apps without embedded browsers or with limited input capabilities.
π² Step 1: Request Device Code
Call the Device Authorization Endpoint with your client_id and required scope. The response will look like:
π» Step 2: Display Info to User
Show the following to the user:
A link to open (verification_uri_complete)
A user_code they may need to enter
The user will open the link in a browser, log in via Skillmine Auth, and enter the code if required.
π Step 3: Poll for Status
In the background, your app must poll the Verification Status Endpoint:
POST{{baseurl}}/device/code/verificationBody:
Poll at intervals specified in the response (interval: 5 seconds).
Possible Responses
While Waiting:
On Success:
β Step 4: Proceed to Dashboard
Once authentication is successful, your app can redirect the user to the main dashboard or start using the token.
Sample : Desktop SSO Integration with Electron using Skillmine Auth
This guide explains how to implement Single Sign-On (SSO) in an Electron-based desktop application using Skillmine Auth, with token-based authentication and user info retrieval.