UNPKG

pulumi-fusionauth

Version:

A Pulumi package for managing FusionAuth instances.

119 lines 7.18 kB
"use strict"; // *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.FusionAuthIdpFacebook = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## # Facebook Identity Provider Resource * * The Facebook identity provider type will use the Facebook OAuth login API. It will provide a `Login with Facebook` button on FusionAuth’s login page that will leverage the Facebook login pop-up dialog. Additionally, this identity provider will call Facebook’s Graph API to load additional details about the user and store them in FusionAuth. * * The email address returned by the Facebook Graph API will be used to create or lookup the existing user. Additional claims returned by Facebook can be used to reconcile the User to FusionAuth by using a Facebook Reconcile Lambda. Unless you assign a reconcile lambda to this provider, on the `email` address will be used from the available claims returned by Facebook. * * When the `picture` field is not requested FusionAuth will also call Facebook’s `/me/picture` API to load the user’s profile image and store it as the `imageUrl` in FusionAuth. When the `picture` field is requested, the user’s profile image will be returned by the `/me` API and a second request to the `/me/picture` endpoint will not be required. * * Finally, FusionAuth will call Facebook’s `/oauth/access_token` API to exchange the login token for a long-lived Facebook token. This token is stored in the `UserRegistration` object inside the `tokens` Map. This Map stores the tokens from the various identity providers so that you can use them in your application to call their APIs. * * Please note if an `idpHint` is appended to the OAuth Authorize endpoint, then the interaction behavior will be defaulted to `redirect`, even if popup interaction is explicitly configured. * * [Facebook Identity Providers API](https://fusionauth.io/docs/v1/tech/apis/identity-providers/facebook) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as fusionauth from "pulumi-fusionauth"; * * const facebook = new fusionauth.FusionAuthIdpFacebook("facebook", { * applicationConfigurations: [{ * applicationId: fusionauth_application.myapp.id, * createRegistration: true, * enabled: true, * }], * buttonText: "Login with Facebook", * debug: false, * enabled: true, * appId: "9876543210", * clientSecret: "716a572f917640698cdb99e9d7e64115", * fields: "email", * permissions: "email", * }); * ``` */ class FusionAuthIdpFacebook extends pulumi.CustomResource { /** * Get an existing FusionAuthIdpFacebook resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new FusionAuthIdpFacebook(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of FusionAuthIdpFacebook. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === FusionAuthIdpFacebook.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["appId"] = state ? state.appId : undefined; resourceInputs["applicationConfigurations"] = state ? state.applicationConfigurations : undefined; resourceInputs["buttonText"] = state ? state.buttonText : undefined; resourceInputs["clientSecret"] = state ? state.clientSecret : undefined; resourceInputs["debug"] = state ? state.debug : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["fields"] = state ? state.fields : undefined; resourceInputs["lambdaReconcileId"] = state ? state.lambdaReconcileId : undefined; resourceInputs["linkingStrategy"] = state ? state.linkingStrategy : undefined; resourceInputs["loginMethod"] = state ? state.loginMethod : undefined; resourceInputs["permissions"] = state ? state.permissions : undefined; resourceInputs["tenantConfigurations"] = state ? state.tenantConfigurations : undefined; } else { const args = argsOrState; if ((!args || args.appId === undefined) && !opts.urn) { throw new Error("Missing required property 'appId'"); } if ((!args || args.buttonText === undefined) && !opts.urn) { throw new Error("Missing required property 'buttonText'"); } if ((!args || args.clientSecret === undefined) && !opts.urn) { throw new Error("Missing required property 'clientSecret'"); } resourceInputs["appId"] = args ? args.appId : undefined; resourceInputs["applicationConfigurations"] = args ? args.applicationConfigurations : undefined; resourceInputs["buttonText"] = args ? args.buttonText : undefined; resourceInputs["clientSecret"] = (args === null || args === void 0 ? void 0 : args.clientSecret) ? pulumi.secret(args.clientSecret) : undefined; resourceInputs["debug"] = args ? args.debug : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["fields"] = args ? args.fields : undefined; resourceInputs["lambdaReconcileId"] = args ? args.lambdaReconcileId : undefined; resourceInputs["linkingStrategy"] = args ? args.linkingStrategy : undefined; resourceInputs["loginMethod"] = args ? args.loginMethod : undefined; resourceInputs["permissions"] = args ? args.permissions : undefined; resourceInputs["tenantConfigurations"] = args ? args.tenantConfigurations : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["clientSecret"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(FusionAuthIdpFacebook.__pulumiType, name, resourceInputs, opts); } } exports.FusionAuthIdpFacebook = FusionAuthIdpFacebook; /** @internal */ FusionAuthIdpFacebook.__pulumiType = 'fusionauth:index/fusionAuthIdpFacebook:FusionAuthIdpFacebook'; //# sourceMappingURL=fusionAuthIdpFacebook.js.map