Docs Menu

Create a User

On this page

  • Create a User Upon First Authentication
  • Create an Email/Password User
  • Confirm a User
  • Re-run the User Confirmation Workflow
  • Summary

For most authentication providers, Atlas App Services automatically creates a user object the first time a user authenticates through the authentication provider. The only exception is email/password user authentication, in which you must register and confirm a user before the user can authenticate.

Tip
Apple Account Deletion Requirements

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 by June 30, 2022.

When you use email/password user authentication, you must register a user, which creates the user object. You can register users in your client application using your preferred SDK, or you can manually create email/password users.

Each SDK offers an API that enables you to register an email/password user. After registering the user, you must confirm the user before the they can authenticate.

You can create a new Email/Password user from the UI or CLI. Manually-created users bypass any configured user confirmation flows.

Tip

This is particularly useful for testing and debugging your application in development.

You must confirm the email address of new Email/Password users before they are permitted to log into Atlas App Services. The exact method of confirmation depends upon your provider configuration, but typically involves a handshake process between the user and your application. You can read more about Email/Password user confirmation at Email/Password Confirmation.

Sometimes, however, users are unable to complete the confirmation process. For example:

  • An overzealous spam filter might block Atlas App Services email confirmation emails.
  • A proxy or web blocker could prevent a user from activating the confirmUser client SDK function via the client application.
  • an implementation error could cause the client application's user confirmation page to fail for specific use cases.

To help you work around cases like this, Atlas App Services allows you to confirm users manually by following the below steps:

  1. Select App Users from the left navigation menu.
  2. Under the Users tab, select the PENDING button.
  3. Find the user in the list and click on the ellipsis (...).
  4. Select the Confirm User option from the context menu that appears.
  5. If the operation succeeds, the banner at the top of the App Services admin console should display a confirmation message. The user's User Status changes from Pending Confirmation to Pending User Login.

A manually-confirmed user continues to appear in the PENDING user list until they log in to your application for the first time, at which point Atlas App Services moves them into the list of confirmed users and transitions their User Status to confirmed.

A few circumstances can lead to incomplete Email/Password user confirmation workflows:

  • An email is caught by a spam filter, not delivered due to a bug, or accidentally deleted by a prospective App Services user.
  • A custom confirmation function is unable to communicate with an unconfirmed user due to a bug or oversight.
  • An unconfirmed user forgot to visit their confirmation link within 30 minutes of receiving their login tokens, and the tokens expired.

Users caught in this situation appear stuck in an unconfirmed state. Since an existing account has their email registered to it, users cannot create a new account with the same email address. Also, they cannot log into an account that is not confirmed.

Applications that use Atlas App Services's built-in email confirmation service can use the resendConfirmationEmail Client SDK method to send a new email with a new confirmation link to the user, allowing them to confirm their account and log in. Calling this method will result in an error by any application using a confirmation flow other than send a confirmation email.

There is no such specific method to re-run a custom confirmation function. Instead, Atlas App Services has a method to trigger a re-run of whatever the current Email/Password user confirmation workflow happens to be. You can manually re-run the currently selected user confirmation flow using the App Services Admin API or via the Atlas App Services UI:

To re-run the confirmation workflow for a user through the Atlas App Services UI:

  1. Select App Users from the left navigation menu.
  2. Under the Users tab, select the PENDING button.
  3. Find the user in the list and click on the ellipsis (...).
  4. Select the Run user confirmation option from the context menu that appears.
  5. Select the Run User Confirmation button in the dialogue box that appears.
  6. If the operation succeeds, the banner at the top of the App Services admin console should display a confirmation message. The user's User Status changes from Pending Confirmation to Pending User Login. Once the user logs in, they will move into the active users list automatically.

If the re-run fails or the user's tokens expire again, you can re-run the confirmation function as many times as necessary.

  • The Email/Password authentication provider requires users to create an account the first time they connect to your App
  • Email/Password users must be confirmed manually through the Atlas App Services UI
  • Users caught in an incomplete Email/Password confirmation workflow must re-run the confirmation through the Atlas App Services UI
←  User ObjectsFind and View a User →
Give Feedback
© 2022 MongoDB, Inc.

About

  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2022 MongoDB, Inc.