UNPKG

pulumi-fusionauth

Version:

A Pulumi package for managing FusionAuth instances.

108 lines 5.96 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.FusionAuthIdpTwitch = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## # Twitch Identity Provider Resource * * The Twitch identity provider type will use the Twitch OAuth v2.0 login API. It will also provide a Login with Twitch button on FusionAuth’s login page that will direct a user to the Twitch login page. * * This identity provider will call Twitch’s API to load the user’s email and preferredUsername and use those as email and username to lookup or create a user in FusionAuth depending on the linking strategy configured for this identity provider. Additional claims returned by Twitch can be used to reconcile the user to FusionAuth by using a Twitch Reconcile Lambda. * * FusionAuth will also store the Twitch refreshToken returned from the Twitch API in the link between the user and the identity provider. This token can be used by an application to make further requests to Twitch APIs on behalf of the user. * * [Twitch Identity Provider APIs](https://fusionauth.io/docs/v1/tech/apis/identity-providers/twitch/) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as fusionauth from "pulumi-fusionauth"; * * const twitch = new fusionauth.FusionAuthIdpTwitch("twitch", { * applicationConfigurations: [{ * applicationId: fusionauth_application.my_app.id, * createRegistration: true, * enabled: true, * }], * buttonText: "Login with Twitch", * clientId: "0eb1ce3c-2fb1-4ae9-b361-d49fc6e764cc", * clientSecret: "693s000cbn66k0mxtqzr_c_NfLy3~6_SEA", * scope: "Xboxlive.signin Xboxlive.offline_access", * }); * ``` */ class FusionAuthIdpTwitch extends pulumi.CustomResource { /** * Get an existing FusionAuthIdpTwitch 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 FusionAuthIdpTwitch(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of FusionAuthIdpTwitch. 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'] === FusionAuthIdpTwitch.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["applicationConfigurations"] = state ? state.applicationConfigurations : undefined; resourceInputs["buttonText"] = state ? state.buttonText : undefined; resourceInputs["clientId"] = state ? state.clientId : undefined; resourceInputs["clientSecret"] = state ? state.clientSecret : undefined; resourceInputs["debug"] = state ? state.debug : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["idpId"] = state ? state.idpId : undefined; resourceInputs["lambdaReconcileId"] = state ? state.lambdaReconcileId : undefined; resourceInputs["linkingStrategy"] = state ? state.linkingStrategy : undefined; resourceInputs["scope"] = state ? state.scope : undefined; resourceInputs["tenantConfigurations"] = state ? state.tenantConfigurations : undefined; } else { const args = argsOrState; if ((!args || args.buttonText === undefined) && !opts.urn) { throw new Error("Missing required property 'buttonText'"); } if ((!args || args.clientId === undefined) && !opts.urn) { throw new Error("Missing required property 'clientId'"); } if ((!args || args.clientSecret === undefined) && !opts.urn) { throw new Error("Missing required property 'clientSecret'"); } resourceInputs["applicationConfigurations"] = args ? args.applicationConfigurations : undefined; resourceInputs["buttonText"] = args ? args.buttonText : undefined; resourceInputs["clientId"] = args ? args.clientId : undefined; resourceInputs["clientSecret"] = args ? args.clientSecret : undefined; resourceInputs["debug"] = args ? args.debug : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["idpId"] = args ? args.idpId : undefined; resourceInputs["lambdaReconcileId"] = args ? args.lambdaReconcileId : undefined; resourceInputs["linkingStrategy"] = args ? args.linkingStrategy : undefined; resourceInputs["scope"] = args ? args.scope : undefined; resourceInputs["tenantConfigurations"] = args ? args.tenantConfigurations : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(FusionAuthIdpTwitch.__pulumiType, name, resourceInputs, opts); } } exports.FusionAuthIdpTwitch = FusionAuthIdpTwitch; /** @internal */ FusionAuthIdpTwitch.__pulumiType = 'fusionauth:index/fusionAuthIdpTwitch:FusionAuthIdpTwitch'; //# sourceMappingURL=fusionAuthIdpTwitch.js.map