Skip to main content

Prerequisites

Prerequisites

  1. Download SDK and Sample Applications:
    • Log in to the Oloid tenant admin portal.
    • Navigate to the “Files” section.
    • Download the Oloid Passwordless SDK files and sample applications.
    • These files will provide you with the necessary components and examples to get started.
  2. Ensure the Oloid Passwordless Service is installed and running on the target machine.
  3. Obtain the API key for your application from the Oloid tenant admin portal.
  4. Know the service URL for the Oloid Passwordless Service (typically net.pipe://localhost/OloidService).
  5. Familiarize yourself with the sample applications provided to understand basic implementation patterns

Understanding Authentication Modes

The Oloid Passwordless SDK supports two authentication modes:
  1. Passive Mode:
    • Used for badge-only authentication.
    • Does not require a user interface.
    • Suitable for background authentication processes.
    • Example use case: Automatic login when an employee badges into their workstation.
  2. Active Mode:
    • Used for all authentication use cases.
    • Launches the Oloid User Interface to capture credentials.
    • Supports various authentication methods: Badge, PIN, Face, NFC, etc.
    • Example use case: User-initiated login process requiring multiple factors.

Step 1: Install the SDK

Add the Oloid Passwordless SDK to your project via NuGet Package Manager or by including the SDK source files directly.

Step 2: Initialize the OloidClient

Create an instance of OloidClient:

Step 3: Subscribe to Authentication Events

Subscribe to authentication events, specifying the authentication type: For Passive (badge-only) authentication:
For Active authentication:

Step 4: Implement the Authentication Handler

Create a method to handle authentication events:

Step 5: Implement Authentication Logic

Implement the AuthenticateUser method according to your application’s authentication system:

Step 6: Handle User Information

Update user profile with information provided by Oloid:

Step 7: Request Authentication (Active Mode Only)

To prompt the user for authentication in Active mode:

Step 8: Using the Oloid User Token

The Oloid User Token contains user claims such as email ID and primary ID. You can use this token for subsequent API calls or to maintain user session:

Best Practices

  1. Mode Selection: Choose Passive mode for badge-only scenarios where background authentication is sufficient. Use Active mode when you need user interaction or multiple authentication factors.
  2. Security: Always handle authentication information and the Oloid User Token securely. Clear sensitive data from memory as soon as possible after use.
  3. Error Handling: Implement robust error handling for all scenarios, including service unavailability and unexpected data.
  4. User Experience: In Active mode, provide clear feedback to the user about the authentication process and any errors that occur.
  5. Testing: Thoroughly test both Passive and Active authentication modes, including all possible authentication statuses.
  6. Logging: Implement logging for troubleshooting, but ensure you’re not logging sensitive information like passwords or tokens.
  7. Configuration: Consider allowing the authentication type to be configurable, so you can switch between Passive and Active modes without code changes.
  8. Token Management: Securely store and manage the Oloid User Token. Use it for maintaining user sessions and accessing Oloid APIs when needed.