UNPKG

pulumi-fusionauth

Version:

A Pulumi package for managing FusionAuth instances.

110 lines 6.41 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.FusionAuthIdpGoogle = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("./utilities"); /** * ## # Google Identity Provider Resource * * The Google identity provider type will use the Google OAuth v2.0 login API. it will provide a Login with Google button on FusionAuth’s login page that will leverage the Google login pop-up dialog. Additionally, this identity provider will call Google’s /oauth2/v3/tokeninfo API to load additional details about the user and store them in FusionAuth. * * The email address returned by the Google Token info API will be used to create or lookup the existing user. Additional claims returned by Google can be used to reconcile the User to FusionAuth by using a Google Reconcile Lambda. Unless you assign a reconcile lambda to this provider, on the email address will be used from the available claims returned by Google. * * FusionAuth will also store the Google accessToken that is returned from the login pop-up dialog 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. * * [Google Identity Providers API](https://fusionauth.io/docs/v1/tech/apis/identity-providers/google#create-the-google-identity-provider) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as fusionauth from "pulumi-fusionauth"; * * const google = new fusionauth.FusionAuthIdpGoogle("google", { * applicationConfigurations: [{ * applicationId: fusionauth_application.myapp.id, * createRegistration: true, * enabled: true, * }], * buttonText: "Login with Google", * debug: false, * clientId: "254311943570-8e2i2hds0qdnee4124socceeh2q2mtjl.apps.googleusercontent.com", * clientSecret: "BRr7x7xz_-cXxIFznBDIdxF1", * scope: "profile", * }); * ``` */ class FusionAuthIdpGoogle extends pulumi.CustomResource { /** * Get an existing FusionAuthIdpGoogle 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 FusionAuthIdpGoogle(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of FusionAuthIdpGoogle. 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'] === FusionAuthIdpGoogle.__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["lambdaReconcileId"] = state ? state.lambdaReconcileId : undefined; resourceInputs["linkingStrategy"] = state ? state.linkingStrategy : undefined; resourceInputs["loginMethod"] = state ? state.loginMethod : undefined; resourceInputs["properties"] = state ? state.properties : 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'"); } resourceInputs["applicationConfigurations"] = args ? args.applicationConfigurations : undefined; resourceInputs["buttonText"] = args ? args.buttonText : undefined; resourceInputs["clientId"] = args ? args.clientId : 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["lambdaReconcileId"] = args ? args.lambdaReconcileId : undefined; resourceInputs["linkingStrategy"] = args ? args.linkingStrategy : undefined; resourceInputs["loginMethod"] = args ? args.loginMethod : undefined; resourceInputs["properties"] = args ? args.properties : undefined; resourceInputs["scope"] = args ? args.scope : undefined; resourceInputs["tenantConfigurations"] = args ? args.tenantConfigurations : undefined; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["clientSecret"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(FusionAuthIdpGoogle.__pulumiType, name, resourceInputs, opts); } } exports.FusionAuthIdpGoogle = FusionAuthIdpGoogle; /** @internal */ FusionAuthIdpGoogle.__pulumiType = 'fusionauth:index/fusionAuthIdpGoogle:FusionAuthIdpGoogle'; //# sourceMappingURL=fusionAuthIdpGoogle.js.map