From 8fc5d1898fdd654a96fb5ba6e236460b84bf986e Mon Sep 17 00:00:00 2001 From: dacharyc Date: Fri, 7 Jun 2024 16:44:21 -0400 Subject: [PATCH 1/2] Draft a Create and Delete Users 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 | 69 ++++ ...-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 | 310 +++++++++++++++++- .../sdk/users/manage-email-password-users.txt | 11 + 22 files changed, 515 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..666f92ba39 --- /dev/null +++ b/source/includes/sdk-examples/users/create-delete-users-delete-users-from-atlas.rst @@ -0,0 +1,69 @@ +.. 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 + + **Closure-Style** + + .. literalinclude:: /examples/generated/code/start/DeleteUsers.snippet.closure-delete-user.swift + :language: swift + + - id: typescript + content: | + + .. literalinclude:: /examples/MissingPlaceholders/example.ts + :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..c9f0191c2a 100644 --- a/source/sdk/users/create-and-delete-users.txt +++ b/source/sdk/users/create-and-delete-users.txt @@ -1,11 +1,315 @@ .. _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 +`. + +You can also 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. + +.. tip:: Atlas Device SDK Users Differ from Other Types of Atlas Users + + 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, you must manually register a +user to create a user object. 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 +---------------------------------- + From 1a7b185c75740c79035c4e7dafbeb7c13062559e Mon Sep 17 00:00:00 2001 From: dacharyc Date: Tue, 18 Jun 2024 15:06:46 -0400 Subject: [PATCH 2/2] Apply review feedback --- ...e-delete-users-delete-users-from-atlas.rst | 4 +- source/sdk/users/create-and-delete-users.txt | 53 ++++++++++--------- 2 files changed, 32 insertions(+), 25 deletions(-) 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 index 666f92ba39..48575abb72 100644 --- 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 @@ -56,14 +56,16 @@ .. 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/MissingPlaceholders/example.ts + .. literalinclude:: /examples/generated/node/authenticate.snippet.delete-user.js :language: typescript diff --git a/source/sdk/users/create-and-delete-users.txt b/source/sdk/users/create-and-delete-users.txt index c9f0191c2a..5fa93c551a 100644 --- a/source/sdk/users/create-and-delete-users.txt +++ b/source/sdk/users/create-and-delete-users.txt @@ -31,36 +31,40 @@ given user. When combined with Sync subscription queries, these features determine what data a user can :ref:`read and write from a synced database `. -You can also associate :ref:`metadata ` or -:ref:`custom data ` with user accounts. +The SDK also provides functionality to extend a user object, and manage +multiple users or identities: -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`. +- 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. -.. tip:: Atlas Device SDK Users Differ from Other Types of Atlas Users +.. _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: +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 ` +- :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. +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: @@ -98,8 +102,9 @@ more details about how to link these identities, refer to Manually Create Users ~~~~~~~~~~~~~~~~~~~~~ -If your app uses email/password authentication, you must manually register a -user to create a user object. For more information about registering +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 @@ -173,7 +178,7 @@ server. 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 +- 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