Prerequisites
Prerequisites
- 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.
- Ensure the Oloid Passwordless Service is installed and running on the target machine.
- Obtain the API key for your application from the Oloid tenant admin portal.
- Know the service URL for the Oloid Passwordless Service (typically
net.pipe://localhost/OloidService). - Familiarize yourself with the sample applications provided to understand basic implementation patterns
Understanding Authentication Modes
The Oloid Passwordless SDK supports two authentication modes:- 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.
- 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 ofOloidClient:
Step 3: Subscribe to Authentication Events
Subscribe to authentication events, specifying the authentication type: For Passive (badge-only) authentication:Step 4: Implement the Authentication Handler
Create a method to handle authentication events:Step 5: Implement Authentication Logic
Implement theAuthenticateUser 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
- 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.
- Security: Always handle authentication information and the Oloid User Token securely. Clear sensitive data from memory as soon as possible after use.
- Error Handling: Implement robust error handling for all scenarios, including service unavailability and unexpected data.
- User Experience: In Active mode, provide clear feedback to the user about the authentication process and any errors that occur.
- Testing: Thoroughly test both Passive and Active authentication modes, including all possible authentication statuses.
- Logging: Implement logging for troubleshooting, but ensure you’re not logging sensitive information like passwords or tokens.
- Configuration: Consider allowing the authentication type to be configurable, so you can switch between Passive and Active modes without code changes.
- Token Management: Securely store and manage the Oloid User Token. Use it for maintaining user sessions and accessing Oloid APIs when needed.