sst 2.3.5 → 2.3.7
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.
package/cli/commands/bind.js
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OauthBasicConfig } from "./oauth.js";
|
|
2
|
+
export declare const FacebookAdapter: (config: OauthBasicConfig) => () => Promise<{
|
|
3
|
+
type: "success";
|
|
4
|
+
properties: {
|
|
5
|
+
tokenset: import("openid-client").TokenSet;
|
|
6
|
+
client: import("openid-client").BaseClient;
|
|
7
|
+
};
|
|
8
|
+
} | {
|
|
9
|
+
type: "step";
|
|
10
|
+
properties: {
|
|
11
|
+
statusCode: number;
|
|
12
|
+
headers: {
|
|
13
|
+
location: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Issuer } from "openid-client";
|
|
2
|
+
import { OauthAdapter } from "./oauth.js";
|
|
3
|
+
// Facebook's OIDC flow returns "id_token" as uri hash in redirect uri. Hashes
|
|
4
|
+
// are not passed to Lambda event object. It is likely that Facebook only wants
|
|
5
|
+
// to support redirecting to a frontend uri.
|
|
6
|
+
//
|
|
7
|
+
// We are only going to support the OAuth flow for now. More details about the flow:
|
|
8
|
+
// https://developers.facebook.com/docs/facebook-login/guides/advanced/oidc-token
|
|
9
|
+
//
|
|
10
|
+
// Also note that Facebook's discover uri does not work for the OAuth flow, as the
|
|
11
|
+
// token_endpoint and userinfo_endpoint are not included in the response.
|
|
12
|
+
// await Issuer.discover("https://www.facebook.com/.well-known/openid-configuration/");
|
|
13
|
+
const issuer = new Issuer({
|
|
14
|
+
issuer: "https://www.facebook.com",
|
|
15
|
+
authorization_endpoint: "https://facebook.com/dialog/oauth/",
|
|
16
|
+
jwks_uri: "https://www.facebook.com/.well-known/oauth/openid/jwks/",
|
|
17
|
+
token_endpoint: "https://graph.facebook.com/oauth/access_token",
|
|
18
|
+
userinfo_endpoint: "https://graph.facebook.com/oauth/access_token",
|
|
19
|
+
});
|
|
20
|
+
export const FacebookAdapter =
|
|
21
|
+
/* @__PURE__ */
|
|
22
|
+
(config) => {
|
|
23
|
+
return OauthAdapter({
|
|
24
|
+
issuer,
|
|
25
|
+
...config,
|
|
26
|
+
});
|
|
27
|
+
};
|
|
@@ -5,7 +5,9 @@ export * from "./adapter/oidc.js";
|
|
|
5
5
|
export * from "./adapter/google.js";
|
|
6
6
|
export * from "./adapter/link.js";
|
|
7
7
|
export * from "./adapter/github.js";
|
|
8
|
+
export * from "./adapter/facebook.js";
|
|
8
9
|
export * from "./adapter/oauth.js";
|
|
9
10
|
export type { Adapter } from "./adapter/adapter.js";
|
|
10
11
|
export * from "./session.js";
|
|
11
12
|
export * from "./handler.js";
|
|
13
|
+
export { Issuer } from "openid-client";
|
|
@@ -5,6 +5,8 @@ export * from "./adapter/oidc.js";
|
|
|
5
5
|
export * from "./adapter/google.js";
|
|
6
6
|
export * from "./adapter/link.js";
|
|
7
7
|
export * from "./adapter/github.js";
|
|
8
|
+
export * from "./adapter/facebook.js";
|
|
8
9
|
export * from "./adapter/oauth.js";
|
|
9
10
|
export * from "./session.js";
|
|
10
11
|
export * from "./handler.js";
|
|
12
|
+
export { Issuer } from "openid-client";
|
package/package.json
CHANGED