clearCredentials API for HoloLens 2
The clearCredentials API allows you to programmatically clear the current user's credentials on HoloLens 2 devices, requiring them to log in again before accessing private experiences. This can be useful for managing session security or resetting user access between sessions.
Example
To implement a logout feature using the clearCredentials API, follow these steps:
1. Add a button to your 3D Eyewear experience and enter Log Out for the Label text.
2. Add the following to Home.js (if adding to a different view, navigate to the JavaScript editor for that view):
$scope.logout = function() {
tml3dRenderer.clearUserCredentials(function() {
$scope.app.fn.navigateToScanMode();
});
}
3. Publish the experience.