@base44-preview/sdk 0.8.39-pr.232.affea8a → 0.8.39-pr.234.1f9d97c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -114,6 +114,7 @@ export interface AppUserConnectorConnectionResponse {
|
|
|
114
114
|
* | Slack Bot | `slackbot` |
|
|
115
115
|
* | Snowflake | `snowflake` |
|
|
116
116
|
* | Splitwise | `splitwise` |
|
|
117
|
+
* | Square | `square` |
|
|
117
118
|
* | Supabase | `supabase` |
|
|
118
119
|
* | TikTok | `tiktok` |
|
|
119
120
|
* | Typeform | `typeform` |
|
package/dist/modules/sso.js
CHANGED
|
@@ -14,5 +14,11 @@ export function createSsoModule(axios, appId) {
|
|
|
14
14
|
const url = `/apps/${appId}/auth/sso/accesstoken/${userid}`;
|
|
15
15
|
return axios.get(url);
|
|
16
16
|
},
|
|
17
|
+
// Get the stored SSO OIDC ID token for a specific user
|
|
18
|
+
async getIdToken(userid) {
|
|
19
|
+
const url = `/apps/${appId}/auth/sso/idtoken/${userid}`;
|
|
20
|
+
const response = await axios.get(url);
|
|
21
|
+
return response;
|
|
22
|
+
},
|
|
17
23
|
};
|
|
18
24
|
}
|
|
@@ -8,9 +8,9 @@ export interface SsoAccessTokenResponse {
|
|
|
8
8
|
/**
|
|
9
9
|
* SSO (Single Sign-On) module for managing SSO authentication.
|
|
10
10
|
*
|
|
11
|
-
* This module provides methods for retrieving SSO
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* This module provides methods for retrieving SSO tokens for users. These
|
|
12
|
+
* tokens allow you to authenticate Base44 users with external systems or
|
|
13
|
+
* services.
|
|
14
14
|
*
|
|
15
15
|
* This module is only available to use with a client in service role authentication mode, which means it can only be used in backend environments.
|
|
16
16
|
*
|
|
@@ -41,4 +41,28 @@ export interface SsoModule {
|
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
43
|
getAccessToken(userid: string): Promise<SsoAccessTokenResponse>;
|
|
44
|
+
/**
|
|
45
|
+
* Gets the stored SSO OIDC ID token for the current app user.
|
|
46
|
+
*
|
|
47
|
+
* The service-role client must include an on-behalf-of token for the same
|
|
48
|
+
* user specified by `userid`. This method returns the stored token as-is and
|
|
49
|
+
* does not refresh it.
|
|
50
|
+
*
|
|
51
|
+
* @param userid - The current app user's ID.
|
|
52
|
+
* @returns Promise resolving to the raw ID-token string.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* import { createClientFromRequest } from 'npm:@base44/sdk';
|
|
57
|
+
*
|
|
58
|
+
* Deno.serve(async (req) => {
|
|
59
|
+
* const base44 = createClientFromRequest(req);
|
|
60
|
+
* const user = await base44.auth.me();
|
|
61
|
+
* const idToken = await base44.asServiceRole.sso.getIdToken(user.id);
|
|
62
|
+
*
|
|
63
|
+
* return Response.json({ idToken });
|
|
64
|
+
* });
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
getIdToken(userid: string): Promise<string>;
|
|
44
68
|
}
|