Skip to content

Commit f67f67a

Browse files
authored
Remove AAS Auth (#708)
4 tickets rolled into one.
1 parent 455551d commit f67f67a

19 files changed

+52
-417
lines changed

config/redirects

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,6 @@ raw: docs/charts/billing-dashboards/ -> ${base}/dashboards/manage-dashboards/bil
5050
raw: docs/charts/dashboard-refresh/ -> ${base}/dashboards/view-dashboard-data/dashboard-refresh/
5151
raw: docs/charts/dashboard-filtering/ -> ${base}/dashboards/view-dashboard-data/dashboard-filtering/
5252
raw: docs/charts/interact-with-charts/ -> ${base}/dashboards/view-dashboard-data/interact-with-charts/
53+
54+
# removal of App Services/Stitch/Realm
55+
raw: docs/charts/embed-chart-stitch-auth/ -> ${base}/embedding-tutorials/

snooty.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ toc_landing_pages = ["/installation",
4242

4343
[constants]
4444
version = "v0.10.0"
45-
app-services = "App Services"
46-
atlas-app-services = "Atlas App Services"
45+
# app-services = "App Services"
46+
# atlas-app-services = "Atlas App Services"
47+
# atlas-app-services-link = ":appservices:`Atlas App Services </>`"
4748
adf = "Atlas Data Federation"
48-
atlas-app-services-link = ":appservices:`Atlas App Services </>`"
4949
atlas-ui = "Atlas UI"
5050
cluster = "cluster"
5151
clusters = "clusters"

source/configure-auth-providers.txt

Lines changed: 8 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Configure Embedding Authentication Providers
55
============================================
66

77
.. meta::
8-
:description: Configure authentication providers for embedding charts using tokens from Atlas App Services, Google, or custom JWTs to ensure secure access.
8+
:description: Configure authentication providers for embedding charts using tokens from Google or custom JWTs to ensure secure access.
99

1010
.. default-domain:: mongodb
1111

@@ -35,35 +35,24 @@ Considerations
3535

3636
- |charts-short| supports these authentication providers:
3737

38-
- :stitch:`Atlas App Services </authentication/>`
3938
- Google
4039
- Custom |jwt|
4140

42-
{+atlas-app-services+} Providers
43-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44-
45-
|charts-short| considers tokens from {+app-services+} providers valid if
46-
they:
41+
.. _configure-google-auth:
4742

48-
- Are syntactically valid |jwt|\s.
49-
50-
- Are issued by the relevant authority.
51-
52-
- Match the {+app-services+} App ID you configure the provider to accept.
53-
54-
Google Providers
55-
~~~~~~~~~~~~~~~~
43+
Google Tokens
44+
~~~~~~~~~~~~~
5645

57-
|charts-short| considers tokens from Google providers valid if they:
46+
|charts-short| considers tokens from Google valid if they:
5847

5948
- Are syntactically valid |jwt|\s.
6049

6150
- Are issued by the relevant authority.
6251

63-
- Match the Google Client ID you configure the provider to accept.
52+
- Match the Google API Client ID you configure the provider to accept.
6453

65-
JWT Providers
66-
~~~~~~~~~~~~~
54+
JWT Provider Tokens
55+
~~~~~~~~~~~~~~~~~~~
6756

6857
.. include:: /includes/jwt-provider-valid-token.rst
6958

source/dashboards/view-dashboard-data/dashboard-refresh.txt

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,18 +179,6 @@ When a dashboard refreshes automatically:
179179
source for the latest data, refreshes the chart, and updates the
180180
data cached on both the client and server.
181181

182-
.. note::
183-
184-
If your chart is embedded using
185-
:ref:`Atlas App Services Authentication <stitch-sdk-tutorial>`
186-
and
187-
:guilabel:`Fetch data using Atlas App Services` is enabled in your
188-
:ref:`Authentication Provider Settings
189-
<configure-auth-providers>`, your chart does not load data from
190-
the server cache. Your ``maxDataAge`` embedding parameter still
191-
dictates how often the chart refreshes, but the data source is
192-
always queried on each render.
193-
194182
Refresh Failures
195183
~~~~~~~~~~~~~~~~
196184

source/embed-chart-stitch-auth.txt

Lines changed: 0 additions & 96 deletions
This file was deleted.

source/embedded-chart-error-codes.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,5 +152,5 @@ Refer to the following table for more information on each error code.
152152
* - ``18``
153153
- Client ID doesn't match provider.
154154

155-
- This error occurs for {+atlas-app-services+} and Google authentication providers
155+
- This error occurs for Google authentication providers
156156
if the token is valid but was issued for a different application.

source/embedding-tutorials.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ login credentials through an SSO provider.
3232
Configure |charts-short| to use Google Sign-In to authorize
3333
the rendering of embedded charts in an application.
3434

35-
:ref:`stitch-sdk-tutorial`
36-
Configure |charts-short| to use {+atlas-app-services-link+} to authorize
37-
the rendering of embedded charts in an application.
38-
3935
:ref:`jwt-sdk-tutorial`
4036
Configure |charts-short| to validate |jwt| to authorize the rendering
4137
of embedded charts in an application.
@@ -51,6 +47,5 @@ Unauthenticated Embedding
5147
:titlesonly:
5248

5349
Use Google-Sign-In Authentication </embed-chart-google-auth.txt>
54-
Use Atlas App Services </embed-chart-stitch-auth.txt>
5550
Use Custom JWT Provider </embed-chart-jwt-auth.txt>
5651
Use an Unauthenticated Chart </embed-chart-anon-auth.txt>

source/filter-embedded-charts.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -370,16 +370,6 @@ This filter ensures that viewers of an embedded chart see only their
370370
own data, which is useful when embedding charts with potentially
371371
sensitive information.
372372

373-
.. note::
374-
375-
If you use an {+atlas-app-services+} authentication provider, ``context.token``
376-
contains the {+app-services+}
377-
:atlas:`user object </app-services/authentication/user-objects/>` to
378-
filter. For example, if you enable
379-
:atlas:`Custom User Data </app-services/users/enable-custom-user-data/>`
380-
for {+app-services+} users, the user object is available in
381-
``context.token.custom_data``.
382-
383373
To inject a filter specific to each user, in the
384374
:guilabel:`Authenticated` tab of the :guilabel:`Embed Chart`
385375
dialog, set the :guilabel:`Injected function`

source/filter-embedded-dashboards.txt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -237,16 +237,6 @@ This filter ensures that viewers of an embedded dashboard only see their
237237
own data, which is useful when embedding dashboard with potentially
238238
sensitive information.
239239

240-
.. note::
241-
242-
If you use an {+atlas-app-services+} authentication provider, ``context.token``
243-
contains the {+app-services+}
244-
:atlas:`user object </app-services/authentication/user-objects/>` to
245-
filter. For example, if you enable
246-
:atlas:`Custom User Data </app-services/users/enable-custom-user-data/>`
247-
for {+app-services+} users, the user object is available in
248-
``context.token.custom_data``.
249-
250240
To inject a filter specific to each user, in the
251241
:guilabel:`Authenticated` tab of the :guilabel:`Embed` dialog, set the
252242
:guilabel:`Injected function`setting to :guilabel:`On`. Specify a

source/get-started-embedding-sdk.txt

Lines changed: 20 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,7 @@ Create a Web App
134134
MongoDB offers :github:`examples of authenticated embedded dashboards </mongodb-js/charts-embed-sdk/tree/master/examples/dashboard/>`
135135
in the GitHub Repository. These examples show you how to use
136136
the Embedding SDK to authenticate an embedded dashboard using
137-
{+atlas-app-services-link+}, Google, or |jwt| authentication
138-
providers.
137+
Google, or |jwt| authentication providers.
139138

140139
Add Embedding Code to Your App
141140
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -188,40 +187,26 @@ To learn how to install the Embedding SDK into your app, see
188187
Add the following code to your web app to execute where you
189188
want your chart to render. The following example
190189
:ref:`authenticates <configure-auth-providers>` with
191-
{+atlas-app-services-link+}.
192-
193-
.. note::
194-
195-
Replace the existing App ID with your App
196-
ID, which you can find in the {+atlas-app-services+} UI. Replace the existing Charts Base URL and chart
197-
ID with the values for the chart that you want to
198-
display. Your Charts Base URL and chart ID are visible
199-
in the embedding options modal window.
190+
a :ref:`Google token <configure-google-auth>`.
200191

201192
.. code-block:: javascript
202193
:copyable: false
203194

204195
import ChartsEmbedSDK from "@mongodb-js/charts-embed-dom";
205196

206-
// Needed only if you are using the Atlas App Services authentication provider
207-
const client = Stitch.initializeAppClient(
208-
'authentication-sample-eibkj', // ~REPLACE~ with your App ID
209-
});
197+
const id_token = googleUser.getAuthResponse().id_token;
198+
const ChartsEmbedSDK = window.ChartsEmbedSDK;
210199

211200
const sdk = new ChartsEmbedSDK({
212-
baseUrl: "https://charts.mongodb.com/charts-embedding-examples-wgffp", // ~REPLACE~ with the Base URL from your Embed Chart dialog.
213-
getUserToken: () => getRealmUserToken(client),
214-
// getUserToken is a callback to provide the auth token to the SDK.
215-
// Use the getRealmUserToken helper when using the Atlas App Services auth provider.
216-
// If using Custom JWT or Google providers, provide your own code to retrieve the JWT
201+
baseUrl: "https://charts.mongodb.com/charts-embedding-examples-wgffp", // Optional: replace with your Charts URL
202+
getUserToken: () => id_token,
217203
});
218204

219205
const chart = sdk.createChart({
220-
chartId: "735cfa75-15b8-483a-bc2e-7c6659511c7c", // ~REPLACE~ with the Chart ID from your Embed Chart dialog.
221-
height: "700px",
222-
// Additional options go here
206+
chartId: "8d4dff93-e7ca-4ccd-a622-e20e8a100197", // Optional: replace with your Chart ID
223207
});
224208

209+
document.body.classList.toggle("logged-in", true);
225210
chart.render(document.getElementById("chart"));
226211

227212
.. tab:: Dashboard
@@ -268,41 +253,28 @@ To learn how to install the Embedding SDK into your app, see
268253
Add the following code to your web app to run it where you
269254
want your dashboard to render. The following example
270255
:ref:`authenticates <configure-auth-providers>` with
271-
{+atlas-app-services-link+}.
272-
273-
.. note::
274-
275-
Replace the existing App ID with your
276-
App ID. You can find your App ID in the {+atlas-app-services+} UI. Replace the existing :guilabel:`Dashboards
277-
Base URL` and dashboard ID with the values for the
278-
dashboard that you want to display. Your :guilabel:`Dashboards Base URL`
279-
and dashboard ID are visible in the embedding options
280-
modal window.
256+
a :ref:`Google token <configure-google-auth>`.
281257

282258
.. code-block:: javascript
283259
:copyable: false
284260

285261
import ChartsEmbedSDK from "@mongodb-js/charts-embed-dom";
286262

287-
// Needed only if you are using the Atlas App Services authentication provider
288-
const client = Stitch.initializeAppClient(
289-
'authentication-sample-eibkj', // ~REPLACE~ with your App ID
290-
});
291-
263+
const id_token = googleUser.getAuthResponse().id_token;
264+
const ChartsEmbedSDK = window.ChartsEmbedSDK;
265+
292266
const sdk = new ChartsEmbedSDK({
293-
baseUrl: "https://charts.mongodb.com/charts-embedding-examples-wgffp", // ~REPLACE~ with the Base URL from your Embed Dashboard dialog.
294-
getUserToken: () => getRealmUserToken(client),
295-
// getUserToken is a callback to provide the auth token to the SDK.
296-
// Use the getRealmUserToken helper when using the Atlas App Services auth provider.
297-
// If using Custom JWT or Google providers, provide your own code to retrieve the JWT
267+
baseUrl: "https://charts.mongodb.com/charts-embedding-examples-wgffp", // Optional: ~REPLACE~ with your Base URL
268+
getUserToken: () => id_token,
298269
});
299270

271+
// Read https://dochub.mongodb.org/core/charts-dashboards-embedded-dashboard-options for more options
300272
const dashboard = sdk.createDashboard({
301-
dashboardId: "735cfa75-15b8-483a-bc2e-7c6659511c7c", // ~REPLACE~ with the Dashboard ID from your Embed Dashboard dialog.
302-
height: "700px",
303-
widthMode: "scale",
304-
heightMode: "fixed"
305-
// Additional options go here
273+
// Optional: ~REPLACE~ with your Dashboard ID
274+
dashboardId: "620c9847-fc5c-4199-865d-27b2ae20db07",
275+
theme: "dark",
276+
widthMode: "scale",
306277
});
307278

279+
document.body.classList.toggle("logged-in", true);
308280
dashboard.render(document.getElementById("dashboard"));

0 commit comments

Comments
 (0)