From c33fc2223168a938e8bbd52c7c91630e68bfa0e0 Mon Sep 17 00:00:00 2001 From: Dachary Date: Tue, 18 Jun 2024 15:10:38 -0400 Subject: [PATCH] (DOCSP-39525): Consolidate Create and Delete Users page (#3289) ## Pull Request Info - SDK Docs Consolidation Jira ticket: https://jira.mongodb.org/browse/DOCSP-39525 *Staged Page* - [Create, Delete, and Remove Users](https://preview-mongodbdacharyc.gatsbyjs.io/realm/DOCSP-39525/sdk/users/create-and-delete-users/) *Page Source* Add links to every SDK's pages where you got the SDK-specific information: - [Flutter: Delete a User](https://www.mongodb.com/docs/atlas/device-sdks/sdk/flutter/users/delete-user/) - [Java: Create and Delete Users](https://www.mongodb.com/docs/atlas/device-sdks/sdk/java/users/create-delete-users/) - [Kotlin: Delete Users](https://www.mongodb.com/docs/atlas/device-sdks/sdk/kotlin/users/delete-users/) - [.NET: Create and Delete Users](https://www.mongodb.com/docs/atlas/device-sdks/sdk/dotnet/manage-users/create-and-delete-users/) - [Node.js: Create and Delete Users](https://www.mongodb.com/docs/atlas/device-sdks/sdk/node/users/create-delete-users/) - [Swift: Create and Delete Users](https://www.mongodb.com/docs/atlas/device-sdks/sdk/swift/users/create-and-delete-users/) ### PR Author Checklist Before requesting a review for your PR, please check these items: - [x] Open the PR against the `feature-consolidated-sdk-docs` branch instead of `master` - [x] Tag the consolidated page for: - genre - meta.keywords - meta.description #### Naming - [x] Update Realm naming and the language around persistence layer/local/device per [this document](https://docs.google.com/document/d/126OczVxBWAwZ4P5ZsSM29WI3REvONEr1ald-mAwPtyQ/edit?usp=sharing) - [x] Include `.rst` files comply with [the naming guidelines](https://docs.google.com/document/d/1h8cr66zoEVeXytVfvDxlCSsUS5IZwvUQvfSCEXNMpek/edit#heading=h.ulh8b5f2hu9) #### Links and Refs - [x] Create new consolidated SDK ref targets starting with "_sdks-" for relevant sections - [x] Remove or update any SDK-specific refs to use the new consolidated SDK ref targets - [x] [Update any Kotlin API links](https://jira.mongodb.org/browse/DOCSP-32519) to use the new Kotlin SDK roles #### Content - [x] Shared code boxes have snippets or placeholders for all 9 languages - [x] API description sections have API details or a generic placeholder for all 9 languages - [x] Check related pages for relevant content to include - [x] Create a ticket for missing examples in each relevant SDK: Consolidation Gaps epic ### Reviewer Checklist As a reviewer, please check these items: - [x] Shared code example boxes contain language-specific snippets or placeholders for every language - [x] API reference details contain working API reference links or generic content - [x] Realm naming/language has been updated - [x] All relevant content from individual SDK pages is present on the consolidated page --- ...elete-users-delete-users-not-supported.rst | 5 + ...elete-users-remove-users-not-supported.rst | 3 + ...-delete-users-delete-users-description.rst | 3 + ...-delete-users-remove-users-description.rst | 3 + ...-delete-users-delete-users-description.rst | 2 + ...-delete-users-remove-users-description.rst | 2 + ...elete-users-delete-users-not-supported.rst | 5 + ...-delete-users-remove-users-description.rst | 5 + ...e-users-delete-users-js-ts-description.rst | 3 + ...e-users-remove-users-js-ts-description.rst | 4 + ...-delete-users-delete-users-description.rst | 3 + ...-delete-users-remove-users-description.rst | 3 + ...-delete-users-delete-users-description.rst | 5 + ...-delete-users-remove-users-description.rst | 5 + ...-delete-users-delete-users-description.rst | 5 + ...-delete-users-remove-users-description.rst | 4 + ...e-delete-users-delete-users-from-atlas.rst | 71 ++++ ...-delete-users-remove-users-from-device.rst | 62 ++++ source/sdk/users.txt | 2 +- source/sdk/users/authenticate-users.txt | 5 + source/sdk/users/create-and-delete-users.txt | 315 +++++++++++++++++- .../sdk/users/manage-email-password-users.txt | 11 + 22 files changed, 522 insertions(+), 4 deletions(-) create mode 100644 source/includes/api-details/cpp/users/create-delete-users-delete-users-not-supported.rst create mode 100644 source/includes/api-details/cpp/users/create-delete-users-remove-users-not-supported.rst create mode 100644 source/includes/api-details/csharp/users/create-delete-users-delete-users-description.rst create mode 100644 source/includes/api-details/csharp/users/create-delete-users-remove-users-description.rst create mode 100644 source/includes/api-details/dart/users/create-delete-users-delete-users-description.rst create mode 100644 source/includes/api-details/dart/users/create-delete-users-remove-users-description.rst create mode 100644 source/includes/api-details/java/users/create-delete-users-delete-users-not-supported.rst create mode 100644 source/includes/api-details/java/users/create-delete-users-remove-users-description.rst create mode 100644 source/includes/api-details/javascript/users/create-delete-users-delete-users-js-ts-description.rst create mode 100644 source/includes/api-details/javascript/users/create-delete-users-remove-users-js-ts-description.rst create mode 100644 source/includes/api-details/kotlin/users/create-delete-users-delete-users-description.rst create mode 100644 source/includes/api-details/kotlin/users/create-delete-users-remove-users-description.rst create mode 100644 source/includes/api-details/objectivec/users/create-delete-users-delete-users-description.rst create mode 100644 source/includes/api-details/objectivec/users/create-delete-users-remove-users-description.rst create mode 100644 source/includes/api-details/swift/users/create-delete-users-delete-users-description.rst create mode 100644 source/includes/api-details/swift/users/create-delete-users-remove-users-description.rst create mode 100644 source/includes/sdk-examples/users/create-delete-users-delete-users-from-atlas.rst create mode 100644 source/includes/sdk-examples/users/create-delete-users-remove-users-from-device.rst diff --git a/source/includes/api-details/cpp/users/create-delete-users-delete-users-not-supported.rst b/source/includes/api-details/cpp/users/create-delete-users-delete-users-not-supported.rst new file mode 100644 index 0000000000..76e79d2a86 --- /dev/null +++ b/source/includes/api-details/cpp/users/create-delete-users-delete-users-not-supported.rst @@ -0,0 +1,5 @@ +The C++ SDK does not have the ability to delete users through the SDK. +You can delete users from the server using the :ref:`App Services +Admin API ` ``delete a user`` endpoints. You could optionally +create an :ref:`Atlas Function ` that uses the Admin API to +delete a user, and :ref:`call the function from the SDK `. diff --git a/source/includes/api-details/cpp/users/create-delete-users-remove-users-not-supported.rst b/source/includes/api-details/cpp/users/create-delete-users-remove-users-not-supported.rst new file mode 100644 index 0000000000..2ae6514771 --- /dev/null +++ b/source/includes/api-details/cpp/users/create-delete-users-remove-users-not-supported.rst @@ -0,0 +1,3 @@ +The C++ SDK does not have the ability to remove users through the SDK. +Instead, you could :ref:`log out the user `, and then manually +delete the user's synced database and cached app files from the filesystem. diff --git a/source/includes/api-details/csharp/users/create-delete-users-delete-users-description.rst b/source/includes/api-details/csharp/users/create-delete-users-delete-users-description.rst new file mode 100644 index 0000000000..18c9421e7e --- /dev/null +++ b/source/includes/api-details/csharp/users/create-delete-users-delete-users-description.rst @@ -0,0 +1,3 @@ +To delete a user, call the :dotnet-sdk:`DeleteUserFromServerAsync(User) +` +method. diff --git a/source/includes/api-details/csharp/users/create-delete-users-remove-users-description.rst b/source/includes/api-details/csharp/users/create-delete-users-remove-users-description.rst new file mode 100644 index 0000000000..03f764a83d --- /dev/null +++ b/source/includes/api-details/csharp/users/create-delete-users-remove-users-description.rst @@ -0,0 +1,3 @@ +Call the :dotnet-sdk:`RemoveUserAsync(User) +` +method to remove the user and their data from the device. diff --git a/source/includes/api-details/dart/users/create-delete-users-delete-users-description.rst b/source/includes/api-details/dart/users/create-delete-users-delete-users-description.rst new file mode 100644 index 0000000000..d5354a7a9f --- /dev/null +++ b/source/includes/api-details/dart/users/create-delete-users-delete-users-description.rst @@ -0,0 +1,2 @@ +Call the :flutter-sdk:`App.deleteUser() ` +on a user object to delete the user's account from your App Services App. diff --git a/source/includes/api-details/dart/users/create-delete-users-remove-users-description.rst b/source/includes/api-details/dart/users/create-delete-users-remove-users-description.rst new file mode 100644 index 0000000000..a82945170d --- /dev/null +++ b/source/includes/api-details/dart/users/create-delete-users-remove-users-description.rst @@ -0,0 +1,2 @@ +Call the :flutter-sdk:`App.removeUser() ` +on a user object to remove the user and their data from the device. diff --git a/source/includes/api-details/java/users/create-delete-users-delete-users-not-supported.rst b/source/includes/api-details/java/users/create-delete-users-delete-users-not-supported.rst new file mode 100644 index 0000000000..32734c0fa5 --- /dev/null +++ b/source/includes/api-details/java/users/create-delete-users-delete-users-not-supported.rst @@ -0,0 +1,5 @@ +The Java SDK does not have the ability to delete users through the SDK. +You can delete users from the server using the :ref:`App Services +Admin API ` ``delete a user`` endpoints. You could optionally +create an :ref:`Atlas Function ` that uses the Admin API to +delete a user, and :ref:`call the function from the SDK `. diff --git a/source/includes/api-details/java/users/create-delete-users-remove-users-description.rst b/source/includes/api-details/java/users/create-delete-users-remove-users-description.rst new file mode 100644 index 0000000000..6e90949246 --- /dev/null +++ b/source/includes/api-details/java/users/create-delete-users-remove-users-description.rst @@ -0,0 +1,5 @@ +To remove a ``User`` object from your client app, call the +:java-sdk:`User.remove() ` or +:java-sdk:`User.removeAsync() +` +method. diff --git a/source/includes/api-details/javascript/users/create-delete-users-delete-users-js-ts-description.rst b/source/includes/api-details/javascript/users/create-delete-users-delete-users-js-ts-description.rst new file mode 100644 index 0000000000..5d9ffa41cc --- /dev/null +++ b/source/includes/api-details/javascript/users/create-delete-users-delete-users-js-ts-description.rst @@ -0,0 +1,3 @@ +Call the :js-sdk:`App.deleteUser() ` method with a +user object to delete the user from your App Services App. This deletes the +object from the server in addition to clearing data from the device. diff --git a/source/includes/api-details/javascript/users/create-delete-users-remove-users-js-ts-description.rst b/source/includes/api-details/javascript/users/create-delete-users-remove-users-js-ts-description.rst new file mode 100644 index 0000000000..ba64373f3c --- /dev/null +++ b/source/includes/api-details/javascript/users/create-delete-users-remove-users-js-ts-description.rst @@ -0,0 +1,4 @@ +Call the :js-sdk:`App.removeUser() +` +method with a user object to remove the user from the device. This clears user +data from the device, but does not delete the user from Atlas. diff --git a/source/includes/api-details/kotlin/users/create-delete-users-delete-users-description.rst b/source/includes/api-details/kotlin/users/create-delete-users-delete-users-description.rst new file mode 100644 index 0000000000..8d828e6b4e --- /dev/null +++ b/source/includes/api-details/kotlin/users/create-delete-users-delete-users-description.rst @@ -0,0 +1,3 @@ +To permanently delete a ``User`` object from both your client app +*and* the Atlas App Services App, call the :kotlin-sync-sdk:`delete +` method on a logged-in user: diff --git a/source/includes/api-details/kotlin/users/create-delete-users-remove-users-description.rst b/source/includes/api-details/kotlin/users/create-delete-users-remove-users-description.rst new file mode 100644 index 0000000000..35f9a1eaaa --- /dev/null +++ b/source/includes/api-details/kotlin/users/create-delete-users-remove-users-description.rst @@ -0,0 +1,3 @@ +To remove a ``User`` object from your client app, call the +:kotlin-sync-sdk:`remove ` +method on a user: diff --git a/source/includes/api-details/objectivec/users/create-delete-users-delete-users-description.rst b/source/includes/api-details/objectivec/users/create-delete-users-delete-users-description.rst new file mode 100644 index 0000000000..0e6af241bd --- /dev/null +++ b/source/includes/api-details/objectivec/users/create-delete-users-delete-users-description.rst @@ -0,0 +1,5 @@ +You can call the :objc-sdk:`-deleteWithCompletion +` +method on a :objc-sdk:`RLMUser object ` to delete the +user object from your App Services App. This deletes the object from the +server in addition to clearing data from the device. diff --git a/source/includes/api-details/objectivec/users/create-delete-users-remove-users-description.rst b/source/includes/api-details/objectivec/users/create-delete-users-remove-users-description.rst new file mode 100644 index 0000000000..6a5cca2a2a --- /dev/null +++ b/source/includes/api-details/objectivec/users/create-delete-users-remove-users-description.rst @@ -0,0 +1,5 @@ +You can call the :objc-sdk:`-removeWithCompletion +` +method on a :objc-sdk:`RLMUser object ` to remove the +user from the device. This clears user data from the device, but does not +delete the user from Atlas. diff --git a/source/includes/api-details/swift/users/create-delete-users-delete-users-description.rst b/source/includes/api-details/swift/users/create-delete-users-delete-users-description.rst new file mode 100644 index 0000000000..3172f9349e --- /dev/null +++ b/source/includes/api-details/swift/users/create-delete-users-delete-users-description.rst @@ -0,0 +1,5 @@ +You can call the :swift-sdk:`delete +` +method on a user object to delete the user object from your App Services App. +This deletes the object from the server in addition to clearing data from the +device. diff --git a/source/includes/api-details/swift/users/create-delete-users-remove-users-description.rst b/source/includes/api-details/swift/users/create-delete-users-remove-users-description.rst new file mode 100644 index 0000000000..9aced36e2d --- /dev/null +++ b/source/includes/api-details/swift/users/create-delete-users-remove-users-description.rst @@ -0,0 +1,4 @@ +You can call the :swift-sdk:`remove +` +method on a user object to remove the user from the device. This clears user +data from the device, but does not delete the user from Atlas. diff --git a/source/includes/sdk-examples/users/create-delete-users-delete-users-from-atlas.rst b/source/includes/sdk-examples/users/create-delete-users-delete-users-from-atlas.rst new file mode 100644 index 0000000000..48575abb72 --- /dev/null +++ b/source/includes/sdk-examples/users/create-delete-users-delete-users-from-atlas.rst @@ -0,0 +1,71 @@ +.. tabs-drivers:: + + tabs: + - id: cpp-sdk + content: | + + .. literalinclude:: /examples/MissingPlaceholders/api.cpp + :language: cpp + + - id: csharp + content: | + + .. literalinclude:: /examples/generated/dotnet/WorkWithRealm.snippet.delete-user.cs + :language: csharp + + - id: dart + content: | + + .. literalinclude:: /examples/generated/flutter/authenticate_users_test.snippet.delete-user.dart + :language: dart + + - id: java + content: | + + .. literalinclude:: /examples/MissingPlaceholders/api.java + :language: java + + - id: java-kotlin + content: | + + .. literalinclude:: /examples/MissingPlaceholders/api-java-kotlin.kt + :language: kotlin + + - id: javascript + content: | + + .. literalinclude:: /examples/generated/node/authenticate.snippet.delete-user.js + :language: javascript + + - id: kotlin + content: | + + .. literalinclude:: /examples/generated/kotlin/AuthenticationTest.snippet.delete-user.kt + :language: kotlin + + - id: objectivec + content: | + + .. literalinclude:: /examples/MissingPlaceholders/example.m + :language: objectivec + + - id: swift + content: | + + **Async/Await** + + .. literalinclude:: /examples/generated/code/start/DeleteUsers.snippet.async-await-delete-user.swift + :language: swift + :copyable: false + + **Closure-Style** + + .. literalinclude:: /examples/generated/code/start/DeleteUsers.snippet.closure-delete-user.swift + :language: swift + :copyable: false + + - id: typescript + content: | + + .. literalinclude:: /examples/generated/node/authenticate.snippet.delete-user.js + :language: typescript diff --git a/source/includes/sdk-examples/users/create-delete-users-remove-users-from-device.rst b/source/includes/sdk-examples/users/create-delete-users-remove-users-from-device.rst new file mode 100644 index 0000000000..82017f7308 --- /dev/null +++ b/source/includes/sdk-examples/users/create-delete-users-remove-users-from-device.rst @@ -0,0 +1,62 @@ +.. tabs-drivers:: + + tabs: + - id: cpp-sdk + content: | + + .. literalinclude:: /examples/MissingPlaceholders/api.cpp + :language: cpp + + - id: csharp + content: | + + .. literalinclude:: /examples/MissingPlaceholders/example.cs + :language: csharp + + - id: dart + content: | + + .. literalinclude:: /examples/MissingPlaceholders/example.dart + :language: dart + + - id: java + content: | + + .. literalinclude:: /examples/MissingPlaceholders/example.java + :language: java + + - id: java-kotlin + content: | + + .. literalinclude:: /examples/MissingPlaceholders/example-java-kotlin.kt + :language: kotlin + + - id: javascript + content: | + + .. literalinclude:: /examples/MissingPlaceholders/example.js + :language: javascript + + - id: kotlin + content: | + + .. literalinclude:: /examples/generated/kotlin/AuthenticationTest.snippet.remove-user.kt + :language: kotlin + + - id: objectivec + content: | + + .. literalinclude:: /examples/MissingPlaceholders/example.m + :language: objectivec + + - id: swift + content: | + + .. literalinclude:: /examples/MissingPlaceholders/example.swift + :language: swift + + - id: typescript + content: | + + .. literalinclude:: /examples/MissingPlaceholders/example.ts + :language: typescript diff --git a/source/sdk/users.txt b/source/sdk/users.txt index b3e4a12a79..c059ed53b7 100644 --- a/source/sdk/users.txt +++ b/source/sdk/users.txt @@ -13,7 +13,7 @@ Manage Users .. toctree:: :titlesonly: - Create and Delete Users + Create, Delete, & Remove Users Authenticate Users Custom User Data User Metadata diff --git a/source/sdk/users/authenticate-users.txt b/source/sdk/users/authenticate-users.txt index dc83c98b78..43f43425c3 100644 --- a/source/sdk/users/authenticate-users.txt +++ b/source/sdk/users/authenticate-users.txt @@ -21,3 +21,8 @@ Offline Login Refresh Token Expiration ------------------------ + +.. _sdks-logout: + +Log a User Out +-------------- \ No newline at end of file diff --git a/source/sdk/users/create-and-delete-users.txt b/source/sdk/users/create-and-delete-users.txt index dc4a3c90b6..5fa93c551a 100644 --- a/source/sdk/users/create-and-delete-users.txt +++ b/source/sdk/users/create-and-delete-users.txt @@ -1,11 +1,320 @@ .. _sdks-create-and-delete-users: -======================= -Create and Delete Users -======================= +================================ +Create, Delete, and Remove Users +================================ + +.. meta:: + :description: Use Atlas Device SDK methods to create, delete, and remove application users. + :keywords: Realm, C++ SDK, Flutter SDK, Kotlin SDK, Java SDK, .NET SDK, Node.js SDK, Swift SDK, code example + +.. facet:: + :name: genre + :values: reference + +.. facet:: + :name: programming_language + :values: cpp, csharp, dart, java, javascript/typescript, kotlin, objective-c, swift .. contents:: On this page :local: :backlinks: none :depth: 2 :class: singlecol + +.. tabs-selector:: drivers + +Atlas Device SDK provides built-in functionality to manage application users, +both on the device and in Atlas. Your application can take advantage of +role-based data access rules to determine the read and write permissions of a +given user. When combined with Sync subscription queries, these features +determine what data a user can :ref:`read and write from a synced database +`. + +The SDK also provides functionality to extend a user object, and manage +multiple users or identities: + +- You can associate :ref:`metadata ` or + :ref:`custom data ` with user accounts. +- Users can have multiple identities. For more information, refer to + :ref:`sdks-link-user-identities`. +- Your app can manage multiple users on a device. For more information, refer + to :ref:`sdks-multi-user-applications`. + +For more information about authentication providers, identities, and user +sessions, refer to :ref:`Authenticate & Manage Users ` +in the App Services documentation. + +.. _sdks-device-sdk-users-vs-other-users: + +Atlas Device SDK Users vs. Other User Types +------------------------------------------- + +Atlas Device SDK users are distinct from :ref:`database users ` +or :ref:`Atlas account users `. SDK users are bounded by the +App Services App where they are registered, and only have access to +resources you provide through the App. Your application can let SDK users: + +- :ref:`Read and write from a synced database ` +- :ref:`Call an Atlas Function ` +- Call :ref:`Data API ` or :ref:`custom HTTPS endpoints ` +- Read and write from specified collections and databases in MongoDB Atlas + through :ref:`the MongoClient API ` + +SDK users do not have direct Atlas database access, or direct Atlas account +access. It is your responsibility to manage these application users, +including complying with data retention or deletion policies and regulatory +requirements where you publish your applications. + +.. _sdks-create-users: + +Create Users +------------ + +For most :ref:`authentication methods `, Atlas App Services +automatically creates a :ref:`user object ` the first time +a user authenticates. The only exception is email/password authentication. +When you use email/password authentication, you must :ref:`register +` and :ref:`confirm +` a user before the user can +authenticate to an App Services App. + +Automatically Create Users +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When you authenticate a user with one of the following authentication +providers, this automatically creates a user object for the user: + +- Anonymous authentication +- OAuth 2.0 through Facebook, Google, and Apple ID +- Custom JWT +- Custom Function + +If your app uses email/password authentication, you must manually create +users either in the client code or in Atlas. + +If you are adding a secondary authentication method, such as adding a +OAuth credential for a user created through anonymous authentication, +you may want to link user identities instead of creating a new user. For +more details about how to link these identities, refer to +:ref:`sdks-link-user-identities`. + +Manually Create Users +~~~~~~~~~~~~~~~~~~~~~ + +If your app uses email/password authentication, your app must explicitly +register a user to create the user object in App Services. This method is +independent of authenticating a user. For more information about registering +email/password users, refer to :ref:`sdks-email-password-user-register`. + +You can also manually create email/password users through App Services. For +more information about manually creating users through the UI, App Services +Admin API, or App Services CLI, refer to :ref:`create-email-password-user` in +the App Services documentation. + +Account Deletion Requirements +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +When you distribute your application through some app stores or in some +regions, an app that requires users to create an account also requires +you to give users the option to delete their account and any associated user +data or metadata. The SDK provides a method you can call from the client code +to comply with these deletion requirements. However, this method only deletes +the user account; it does not delete any associated user data or metadata. + +Following is a resource that provides some details about these account deletion +requirements for distribution through the Apple and Google app stores. This +is not intended to be a comprehensive list of resources related to account +deletion requirements. Consult your distribution agreements and any relevant +regulations in the regions where you plan to distribute your application to +ensure you comply with all applicable account and data deletion policies. + +.. tabs:: + + .. tab:: Apple App Store Requirements + :tabid: apple + + Apple :apple:`requires that applications listed through its App Store + ` must give any user who creates + an account the option to delete the account. Whether you use an + authentication method where you must manually register a user, such as + email/password authentication, or one that that automatically creates a + user, such as Sign-In with Apple, you must implement user account deletion. + + .. tab:: Google Play Store Requirements + :tabid: google + + Google requires that applications listed through its Google Play store + must give any user who creates an account `an in-app path to delete the + account and its associated data + `__. + Whether you use an authentication method where you must manually register a + user, such as email/password authentication, or one that that automatically + creates a user, such as Sign-In with Google, you must implement user account + deletion. + +.. _sdks-delete-users: + +Delete Users from Atlas +----------------------- + +The SDK provides a method you can call from an application to delete the +user object. This sends a request to Atlas to delete the user from the +server. + +.. important:: + + Deleting a user only deletes the user object, which may contain associated + :ref:`metadata `. This does not delete :ref:`custom + user data ` or user-entered data from your + application. If you collect additional user data, you must implement your + own methods or processes to delete that data. + + You can use the :ref:`Authentication Trigger DELETE event + ` to programmatically clean up other + data when you delete a user. For example, you can delete the user's data + from your custom user data collection or another service. + +Calling the user delete method performs the following: + +- Deletes synced databases associated with the user from the device. +- Deletes the ``User`` object from the Atlas App Services server. +- Sets the user state on the device to removed. + +Because this method deletes any synced databases owned by the user, you +should only call this method after closing the user's databases. + +If the deleted user wants to use your app in the future, the user must +sign up for a new account. They can use the same credentials +(depending on the authentication provider), +but the new account does not have the same user ID or links to custom user data +as their deleted account. + +.. tabs-drivers:: + + .. tab:: + :tabid: cpp-sdk + + .. include:: /includes/api-details/cpp/users/create-delete-users-delete-users-not-supported.rst + + .. tab:: + :tabid: csharp + + .. include:: /includes/api-details/csharp/users/create-delete-users-delete-users-description.rst + + .. tab:: + :tabid: dart + + .. include:: /includes/api-details/dart/users/create-delete-users-delete-users-description.rst + + .. tab:: + :tabid: java + + .. include:: /includes/api-details/java/users/create-delete-users-delete-users-not-supported.rst + + .. tab:: + :tabid: java-kotlin + + .. include:: /includes/api-details/java/users/create-delete-users-delete-users-not-supported.rst + + .. tab:: + :tabid: javascript + + .. include:: /includes/api-details/javascript/users/create-delete-users-delete-users-js-ts-description.rst + + .. tab:: + :tabid: kotlin + + .. include:: /includes/api-details/kotlin/users/create-delete-users-delete-users-description.rst + + .. tab:: + :tabid: objectivec + + .. include:: /includes/api-details/objectivec/users/create-delete-users-delete-users-description.rst + + .. tab:: + :tabid: swift + + .. include:: /includes/api-details/swift/users/create-delete-users-delete-users-description.rst + + .. tab:: + :tabid: typescript + + .. include:: /includes/api-details/javascript/users/create-delete-users-delete-users-js-ts-description.rst + +.. include:: /includes/sdk-examples/users/create-delete-users-delete-users-from-atlas.rst + +.. _sdks-remove-users: + +Remove Users from Device +------------------------ + +In some cases, you may not want to delete a user entirely, but may want to +remove them from the device. In this scenario, users continue to exist in +Atlas. You may want to force users to re-authenticate under some circumstances, +such as when a paid subscription expires. Or you may want to temporarily +persist a user on the server to allow for account recovery. + +Removing a user: + +- *Does not* delete the ``User`` object from the Atlas App Services App. +- :ref:`Logs the user ` out if they are logged in. +- Deletes synced databases associated with the user from the device. +- Sets the user's state to removed. + +Because removing a user deletes any synced databases owned by the user, you +should only call this method after closing the user's databases. + +.. tabs-drivers:: + + .. tab:: + :tabid: cpp-sdk + + .. include:: /includes/api-details/cpp/users/create-delete-users-remove-users-not-supported.rst + + .. tab:: + :tabid: csharp + + .. include:: /includes/api-details/csharp/users/create-delete-users-remove-users-description.rst + + .. tab:: + :tabid: dart + + .. include:: /includes/api-details/dart/users/create-delete-users-remove-users-description.rst + + .. tab:: + :tabid: java + + .. include:: /includes/api-details/java/users/create-delete-users-remove-users-description.rst + + .. tab:: + :tabid: java-kotlin + + .. include:: /includes/api-details/java/users/create-delete-users-remove-users-description.rst + + .. tab:: + :tabid: javascript + + .. include:: /includes/api-details/javascript/users/create-delete-users-remove-users-js-ts-description.rst + + .. tab:: + :tabid: kotlin + + .. include:: /includes/api-details/kotlin/users/create-delete-users-remove-users-description.rst + + .. tab:: + :tabid: objectivec + + .. include:: /includes/api-details/objectivec/users/create-delete-users-remove-users-description.rst + + .. tab:: + :tabid: swift + + .. include:: /includes/api-details/swift/users/create-delete-users-remove-users-description.rst + + .. tab:: + :tabid: typescript + + .. include:: /includes/api-details/javascript/users/create-delete-users-remove-users-js-ts-description.rst + +.. include:: /includes/sdk-examples/users/create-delete-users-remove-users-from-device.rst diff --git a/source/sdk/users/manage-email-password-users.txt b/source/sdk/users/manage-email-password-users.txt index bcc39ed5fa..4d1182c500 100644 --- a/source/sdk/users/manage-email-password-users.txt +++ b/source/sdk/users/manage-email-password-users.txt @@ -11,3 +11,14 @@ Manage Email/Password Users :class: singlecol Placeholder page for information about managing email/password users. + +.. _sdks-email-password-user-register: + +Register an New User Account +---------------------------- + +.. _sdks-email-password-user-confirm: + +Confirm a New User's Email Address +---------------------------------- +