-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathmanage-users.txt
99 lines (74 loc) · 3.49 KB
/
manage-users.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
.. meta::
:robots: noindex, nosnippet
=======================
Manage Users - Java SDK
=======================
.. toctree::
:titlesonly:
Create and Delete Users </sdk/java/users/create-delete-users>
Authenticate Users </sdk/java/users/authenticate-users>
Custom User Data </sdk/java/users/custom-user-data>
Manage Email/Password Users </sdk/java/users/email-password-users>
Multi-User Applications </sdk/java/users/multi-user-applications>
Link User Identities </sdk/java/users/link-user-identities>
Create & Manage User API Keys </sdk/java/users/manage-user-api-keys>
.. contents:: On this page
:local:
:backlinks: none
:depth: 2
:class: singlecol
When you use Atlas App Services to back your client app, you get access to a
:ref:`user object <user-objects>`. Use Java SDK methods with this user
object to conveniently:
- Create and delete users
- Log users in and out
- Create and update custom user data
.. _java-creating-and-deleting-users:
Create and Delete Users
-----------------------
For all authentication providers other than email/password authentication,
App Services automatically :ref:`creates a user object <java-create-user>`
the first time a user authenticates. If a user authenticates via more than
one method, you can :ref:`link these user identities <java-link-user-identities>`
to a single user object.
You can :ref:`delete user objects <java-delete-user>`. Deleting a user object
deletes metadata attached to the user object, but does not delete user-entered
data from the backend.
.. _java-access-the-app-client:
Log Users In and Out
--------------------
Use one or more :ref:`authentication providers <auth-providers>` to :ref:`log
users in and out <java-authenticate-users>` of your client app. You can:
- Log users in with an existing social account, such as Apple, Facebook,
or Google.
- Create new user accounts with App Services email/password management,
or your own custom function or custom JWT user management.
- Enable anonymous users to let users access your App Services App without persisting
user data.
When you have a logged-in user, SDK methods enable you to:
- :ref:`Open a synced realm <java-synced-realms>` with the user's
configuration object
- :ref:`Run a backend function <java-call-a-function>` as the logged-in user
- :ref:`Log the user out <java-logout>`
- :ref:`Change the active user <java-change-the-active-user>` in a multi-user
application
- :ref:`Remove a user <java-remove-a-user-from-the-device>` from the device
On successful login, the Java SDK caches credentials on the device. You
can bypass the login flow and access the cached user. Use this to open a
realm or call a function upon subsequent app opens.
User Sessions
~~~~~~~~~~~~~
App Services manages sessions with access tokens and refresh tokens.
Client SDKs supply the logic to manage tokens, and provide them with requests.
.. seealso::
:ref:`<user-sessions>`
.. _java-app-work-with-custom-user-data:
Read and Update Custom User Data
--------------------------------
You can :ref:`associate custom data <custom-user-data>` with a user object,
such as a preferred language or local timezone, and read it from your client
application. A user object has a ``customData`` property that you can use
to :ref:`access custom user data <java-custom-user-data>`.
To create and update custom user data, you must access
your MongoDB data source directly. App Services does not offer a SDK
method to create or update this custom user data; it's a read-only property.