Desktop SSO Integration

To integrate the Skillmine Auth login page into a desktop application, you can use either of the following authentication flows:

  1. Browser-Based Authorization Flow

  2. Device Authorization Flow

Each flow requires setting up your client in the Skillmine Auth admin portal first.


πŸ› οΈ Prerequisites

Before starting integration:

  1. Go to the Skillmine Auth Admin Portal.

  2. Create the Client Settings and Blueprint Configuration using the below documentation:

  3. 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/verification Body:

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.

🧱 Prerequisites

βš™οΈ Step 1: Configure Skillmine Auth

βž” Client Settings

Create a new client in the Skillmine Auth admin panel:

  • Allowed Grant Types: authorization_code, implicit

  • Redirect URI: http://localhost:3000/callback

  • Scopes: openid profile user_info_all

  • Response Types: token (or code)

πŸ“Ž Docs: Client Settings

πŸ“‚ Step 2: Sample Electron Code

1. main.js (Electron main process)

2. preload.js (Exposes IPC)

3. index.html (Renderer process UI)

Step 3 : Execution

βœ… Summary Flow

Last updated