Skip to content

Commit e4fe08b

Browse files
[msid][docs-update] changes in the global signout section
1 parent a137eff commit e4fe08b

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

articles/active-directory/develop/tutorial-v2-shared-device-mode.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,28 @@ private void onSignInClicked()
184184

185185
### Globally sign out a user
186186

187-
To receive the account change broadcast, you'll need to register a broadcast receiver.  It’s recommended to register your broadcast receiver via the Context. For more information about Context, [Context-registered receivers](https://developer.android.com/guide/components/broadcasts#context-registered-receivers)
187+
The following removes the signed-in account and clears cached tokens from not only the app but also from the device that is in shared device mode:
188+
189+
```java
190+
private void onSignOutClicked()
191+
{
192+
mSingleAccountApp.signOut(new ISingleAccountPublicClientApplication.SignOutCallback()
193+
{
194+
@Override
195+
public void onSignOut()
196+
{
197+
updateSignedOutUI();
198+
}
199+
@Override
200+
public void onError(@NonNull MsalException exception)
201+
{
202+
/*failed to remove account with an exception*/
203+
}
204+
});
205+
}
206+
```
207+
208+
To receive the account change broadcast, you'll need to register a broadcast receiver.  It’s recommended to register your broadcast receiver via the Context. For more information about Context, see [Context-registered receivers](https://developer.android.com/guide/components/broadcasts#context-registered-receivers)
188209
189210
When an account change broadcast is received, immediately get the signed in user and determine if a user has changed on the device. If a change is detected, initiate data cleanup for previously signed-in account. It is recommended to properly stop any operations and do data cleanup.
190211

0 commit comments

Comments
 (0)