You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: v2/community/reusableMD/intro-architecture.mdx
+2-3
Original file line number
Diff line number
Diff line change
@@ -9,18 +9,17 @@ values={[
9
9
{label: 'Self hosted', value: 'ss'},
10
10
]}>
11
11
<TabItemvalue="ms">
12
-
<imgsrc="/img/architecture/managed_service_generic.png"alt="Flowchart of architecture when using SuperTokens managed service" />
12
+
<imgsrc="/img/architecture/managed_service_without_dashboard.png"alt="Flowchart of architecture when using SuperTokens managed service" />
13
13
</TabItem>
14
14
<TabItemvalue="ss">
15
-
<imgsrc="/img/architecture/self_hosted_generic.png"alt="Flowchart of architecture when self-hosting SuperTokens" />
15
+
<imgsrc="/img/architecture/self_hosted_without_dashboard.png"alt="Flowchart of architecture when self-hosting SuperTokens" />
16
16
</TabItem>
17
17
</Tabs>
18
18
19
19
There are three components to SuperTokens:
20
20
-**Frontend SDK**: Provides pre built UI, helper functions and / or session management on the frontend.
21
21
-**Backend SDK**:
22
22
- Provides a middleware which exposes all the auth related APIs for your frontend to call. It also handles session management and access control for your APIs.
23
-
- Serves the user management dashboard which can be accessed on the `/auth/dashboard` path of your API domain.
24
23
- If your tech stack uses a backend framework that is not supported by SuperTokens, you can follow our [guide on spinning up a separate server configured with the SuperTokens backend SDK](/docs/community/other-frameworks) to authenticate requests and issue session tokens.
25
24
-**SuperTokens core service**: This is called by the backend SDK to maintain state in the database. This can either be self hosted using docker or be managed by us if you sign up on supertokens.com
- For self hosted users, please [sign up](https://supertokens.com/auth) to generate a license key and follow the instructions sent to you by email.
109
-
- For managed service users, you can click on the "enable paid features" button on [our dashboard](https://supertokens.com/dashboard-saas), and follow the steps from there on.
110
-
111
-
*: A dashboard user is a user that can log into and view the user management dashboard. These users are independent to the users of your application
112
-
113
-
</CustomAdmonition>
114
-
115
-
When you first setup SuperTokens, there are no credentials created for the dashboard. If you click the "Add a new user" button in the dashboard login screen you can see the command you need to execute in order to create credentials.
To create credentials you need to make a request to SuperTokens core.
120
-
121
-
- The example above uses the demo core `https://try.supertokens.com`, replace this with the connection uri you pass to the backend SDK when initialising SuperTokens.
122
-
- Replace `<YOUR-API-KEY>` with your API key. If you are using a self hosted SuperTokens core there is no API key by default. In that case you can either skip or ignore the `api-key` header.
123
-
- Replace `<YOUR_EMAIL>` and `<YOUR_PASSWORD>` with the appropriate values.
124
-
125
-
:::caution
126
-
If using self hosted SuperTokens core, you need to make sure that you add an API key to the core in case it's exposed to the internet. Otherwise anyone will be able to create or modify dashboard users.
127
-
128
-
You can add an API key to the core by following the instructions "Auth flow customizations" > "SuperTokens core settings" > "Adding API keys" page.
129
-
:::
130
-
131
-
## Updating dashboard credentials
132
-
133
-
You can update the email or password of existing credentials by using the "Forgot Password" button on the dashboard login page.
To update credentials you need to make a request to SuperTokens core.
138
-
139
-
- The example above uses the demo core `https://try.supertokens.com`, replace this with the connection uri you pass to the backend SDK when initialising SuperTokens.
140
-
- Replace `<YOUR-API-KEY>` with your API key. If you are using a self hosted SuperTokens core there is no API key by default. In that case you can either skip or ignore the `api-key` header.
141
-
- Replace `<YOUR_EMAIL>` and `<YOUR_NEW_PASSWORD>` with the appropriate values. You can use `newEmail` instead of `newPassword` if you want to update the email
142
-
143
-
## Viewing users list
144
-
145
-
If you have just created your app, you may not have any users to show on the dashboard.
Navigate to the your frontend app and create a user (via the sign up flow). On creation, if you head back to the dashboard and refresh the page, you will see that user:
150
-
151
-
<imgsrc="/img/dashboard/one-user.png"alt="One user in dashboard" />
152
-
153
-
</AppInfoForm>
154
-
155
-
## User details page
156
-
157
-
When you select a user you can view detailed information about the user such as email, phone number, user metadata etc.
158
-
159
-
<imgsrc="/img/dashboard/user-info.png"alt="One user in dashboard" />
160
-
161
-
<imgsrc="/img/dashboard/user-info-continued.png"alt="One user in dashboard" />
162
-
163
-
You can edit user information and perform actions such as resetting a user's password or revoke sessions for a user.
164
-
165
-
<imgsrc="/img/dashboard/reset-password.png"alt="One user in dashboard" />
166
-
167
-
:::important Note
168
-
Some features such as user metadata and email verification have to be enabled in your backend before you can use them in the user management dashboard
169
-
:::
170
-
171
-
## Managing roles and permissions
172
-
173
-
:::note
174
-
Coming Soon
175
-
:::
176
-
177
-
## Restricting access to dashboard users
178
-
179
-
When using the dashboard recipe you can restrict access to certain features by providing a list of emails to be considered as "admins". When a dashboard user logs in with an email not present in this list, they will only be able to perform read operations and all write operations will result in the backend SDKs failing the request.
180
-
181
-
You can provide an array of emails to the backend SDK when initialising the dashboard recipe:
182
-
183
-
:::important
184
-
- Not providing an admins array will result in all dashboard users being allowed both read and write operations
185
-
- Providing an empty array as admins will result in all dashboard users having ONLY read access
If you return a `Content-Security-Policy` header in from your backend, you will need to include the following directives for the user management dashboard to work correctly
0 commit comments