pulumi-fusionauth
Version:
A Pulumi package for managing FusionAuth instances.
146 lines • 10.3 kB
JavaScript
;
// *** 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.FusionAuthIdpOpenIdConnect = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* ## # OpenID Connect Identity Provider Resource
*
* OpenID Connect identity providers connect to external OpenID Connect login systems. This type of login will optionally provide a Login with … button on FusionAuth’s login page. This button is customizable by using different properties of the identity provider.
*
* Optionally, this identity provider can define one or more domains it is associated with. This is useful for allowing employees to log in with their corporate credentials. As long as the company has an identity solution that provides OpenID Connect, you can leverage this feature. This is referred to as a Domain Based Identity Provider. If you enable domains for an identity provider, the Login with … button will not be displayed. Instead, only the email form field will be displayed initially on the FusionAuth login page. Once the user types in their email address, FusionAuth will determine if the user is logging in locally or if they should be redirected to this identity provider. This is determined by extracting the domain from their email address and comparing it to the domains associated with the identity provider.
*
* FusionAuth will also leverage the /userinfo API that is part of the OpenID Connect specification. The email address returned from the Userinfo response will be used to create or lookup the existing user. Additional claims from the Userinfo response can be used to reconcile the User in FusionAuth by using an OpenID Connect Reconcile Lambda. Unless you assign a reconcile lambda to this provider, on the email address will be used from the available claims returned by the OpenID Connect identity provider.
*
* If the external OpenID Connect identity provider returns a refresh token, it will be 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.
*
* [OpenID Connect Identity Providers API](https://fusionauth.io/docs/v1/tech/apis/identity-providers/openid-connect)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as fusionauth from "pulumi-fusionauth";
*
* const openID = new fusionauth.FusionAuthIdpOpenIdConnect("openID", {
* applicationConfigurations: [{
* applicationId: fusionauth_application.myapp.id,
* createRegistration: true,
* enabled: true,
* }],
* oauth2AuthorizationEndpoint: "https://acme.com/oauth2/authorization",
* oauth2ClientId: "191c23dc-b772-4558-bd21-dc1cbf74ae21",
* oauth2ClientSecret: "SUsnoP0pWUYfXvWbSe5pvj8Di5nAxOvO",
* oauth2ClientAuthenticationMethod: "client_secret_basic",
* oauth2Scope: "openid offline_access",
* oauth2TokenEndpoint: "https://acme.com/oauth2/token",
* oauth2UserInfoEndpoint: "https://acme.com/oauth2/userinfo",
* buttonText: "Login with OpenID Connect",
* debug: false,
* enabled: true,
* tenantConfigurations: [{
* tenantId: fusionauth_tenant.example.id,
* limitUserLinkCountEnabled: false,
* limitUserLinkCountMaximumLinks: 42,
* }],
* });
* ```
*/
class FusionAuthIdpOpenIdConnect extends pulumi.CustomResource {
/**
* Get an existing FusionAuthIdpOpenIdConnect 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 FusionAuthIdpOpenIdConnect(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of FusionAuthIdpOpenIdConnect. 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'] === FusionAuthIdpOpenIdConnect.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["applicationConfigurations"] = state ? state.applicationConfigurations : undefined;
resourceInputs["buttonImageUrl"] = state ? state.buttonImageUrl : undefined;
resourceInputs["buttonText"] = state ? state.buttonText : undefined;
resourceInputs["debug"] = state ? state.debug : undefined;
resourceInputs["domains"] = state ? state.domains : 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["name"] = state ? state.name : undefined;
resourceInputs["oauth2AuthorizationEndpoint"] = state ? state.oauth2AuthorizationEndpoint : undefined;
resourceInputs["oauth2ClientAuthenticationMethod"] = state ? state.oauth2ClientAuthenticationMethod : undefined;
resourceInputs["oauth2ClientId"] = state ? state.oauth2ClientId : undefined;
resourceInputs["oauth2ClientSecret"] = state ? state.oauth2ClientSecret : undefined;
resourceInputs["oauth2EmailClaim"] = state ? state.oauth2EmailClaim : undefined;
resourceInputs["oauth2EmailVerifiedClaim"] = state ? state.oauth2EmailVerifiedClaim : undefined;
resourceInputs["oauth2Issuer"] = state ? state.oauth2Issuer : undefined;
resourceInputs["oauth2Scope"] = state ? state.oauth2Scope : undefined;
resourceInputs["oauth2TokenEndpoint"] = state ? state.oauth2TokenEndpoint : undefined;
resourceInputs["oauth2UniqueIdClaim"] = state ? state.oauth2UniqueIdClaim : undefined;
resourceInputs["oauth2UserInfoEndpoint"] = state ? state.oauth2UserInfoEndpoint : undefined;
resourceInputs["oauth2UsernameClaim"] = state ? state.oauth2UsernameClaim : undefined;
resourceInputs["postRequest"] = state ? state.postRequest : 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.oauth2ClientId === undefined) && !opts.urn) {
throw new Error("Missing required property 'oauth2ClientId'");
}
resourceInputs["applicationConfigurations"] = args ? args.applicationConfigurations : undefined;
resourceInputs["buttonImageUrl"] = args ? args.buttonImageUrl : undefined;
resourceInputs["buttonText"] = args ? args.buttonText : undefined;
resourceInputs["debug"] = args ? args.debug : undefined;
resourceInputs["domains"] = args ? args.domains : 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["name"] = args ? args.name : undefined;
resourceInputs["oauth2AuthorizationEndpoint"] = args ? args.oauth2AuthorizationEndpoint : undefined;
resourceInputs["oauth2ClientAuthenticationMethod"] = args ? args.oauth2ClientAuthenticationMethod : undefined;
resourceInputs["oauth2ClientId"] = args ? args.oauth2ClientId : undefined;
resourceInputs["oauth2ClientSecret"] = (args === null || args === void 0 ? void 0 : args.oauth2ClientSecret) ? pulumi.secret(args.oauth2ClientSecret) : undefined;
resourceInputs["oauth2EmailClaim"] = args ? args.oauth2EmailClaim : undefined;
resourceInputs["oauth2EmailVerifiedClaim"] = args ? args.oauth2EmailVerifiedClaim : undefined;
resourceInputs["oauth2Issuer"] = args ? args.oauth2Issuer : undefined;
resourceInputs["oauth2Scope"] = args ? args.oauth2Scope : undefined;
resourceInputs["oauth2TokenEndpoint"] = args ? args.oauth2TokenEndpoint : undefined;
resourceInputs["oauth2UniqueIdClaim"] = args ? args.oauth2UniqueIdClaim : undefined;
resourceInputs["oauth2UserInfoEndpoint"] = args ? args.oauth2UserInfoEndpoint : undefined;
resourceInputs["oauth2UsernameClaim"] = args ? args.oauth2UsernameClaim : undefined;
resourceInputs["postRequest"] = args ? args.postRequest : undefined;
resourceInputs["tenantConfigurations"] = args ? args.tenantConfigurations : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const secretOpts = { additionalSecretOutputs: ["oauth2ClientSecret"] };
opts = pulumi.mergeOptions(opts, secretOpts);
super(FusionAuthIdpOpenIdConnect.__pulumiType, name, resourceInputs, opts);
}
}
exports.FusionAuthIdpOpenIdConnect = FusionAuthIdpOpenIdConnect;
/** @internal */
FusionAuthIdpOpenIdConnect.__pulumiType = 'fusionauth:index/fusionAuthIdpOpenIdConnect:FusionAuthIdpOpenIdConnect';
//# sourceMappingURL=fusionAuthIdpOpenIdConnect.js.map