REST Resource: locations.workforcePools.providers

Resource: WorkforcePoolProvider

A configuration for an external identity provider.

JSON representation
{
  "name": string,
  "displayName": string,
  "description": string,
  "state": enum (State),
  "disabled": boolean,
  "attributeMapping": {
    string: string,
    ...
  },
  "attributeCondition": string,
  "expireTime": string,
  "extraAttributesOauth2Client": {
    object (ExtraAttributesOAuth2Client)
  },

  // Union field provider_config can be only one of the following:
  "saml": {
    object (Saml)
  },
  "oidc": {
    object (Oidc)
  }
  // End of list of possible types for union field provider_config.
}
Fields
name

string

Output only. The resource name of the provider.

Format: locations/{location}/workforcePools/{workforcePoolId}/providers/{providerId}

displayName

string

A user-specified display name for the provider.

Cannot exceed 32 characters.

description

string

A user-specified description of the provider. Cannot exceed 256 characters.

state

enum (State)

Output only. The state of the provider.

disabled

boolean

Disables the workforce pool provider. You cannot use a disabled provider to exchange tokens. However, existing tokens still grant access.

attributeMapping

map (key: string, value: string)

Required. Maps attributes from the authentication credentials issued by an external identity provider to Google Cloud attributes, such as subject and segment.

Each key must be a string specifying the Google Cloud IAM attribute to map to.

The following keys are supported:

  • google.subject: The principal IAM is authenticating. You can reference this value in IAM bindings. This is also the subject that appears in Cloud Logging logs. This is a required field and the mapped subject cannot exceed 127 bytes.

  • google.groups: Groups the authenticating user belongs to. You can grant groups access to resources using an IAM principalSet binding; access applies to all members of the group.

  • google.display_name: The name of the authenticated user. This is an optional field and the mapped display name cannot exceed 100 bytes. If not set, google.subject will be displayed instead. This attribute cannot be referenced in IAM bindings.

  • google.profile_photo: The URL that specifies the authenticated user's thumbnail photo. This is an optional field. When set, the image will be visible as the user's profile picture. If not set, a generic user icon will be displayed instead. This attribute cannot be referenced in IAM bindings.

  • google.posix_username: The Linux username used by OS Login. This is an optional field and the mapped POSIX username cannot exceed 32 characters, The key must match the regex "^[a-zA-Z0-9._][a-zA-Z0-9._-]{0,31}$". This attribute cannot be referenced in IAM bindings.

You can also provide custom attributes by specifying attribute.{custom_attribute}, where {custom_attribute} is the name of the custom attribute to be mapped. You can define a maximum of 50 custom attributes. The maximum length of a mapped attribute key is 100 characters, and the key may only contain the characters [a-z0-9_].

You can reference these attributes in IAM policies to define fine-grained access for a workforce pool to Google Cloud resources. For example:

  • google.subject: principal://iam.googleapis.com/locations/global/workforcePools/{pool}/subject/{value}

  • google.groups: principalSet://iam.googleapis.com/locations/global/workforcePools/{pool}/group/{value}

  • attribute.{custom_attribute}: principalSet://iam.googleapis.com/locations/global/workforcePools/{pool}/attribute.{custom_attribute}/{value}

Each value must be a Common Expression Language function that maps an identity provider credential to the normalized attribute specified by the corresponding map key.

You can use the assertion keyword in the expression to access a JSON representation of the authentication credential issued by the provider.

The maximum length of an attribute mapping expression is 2048 characters. When evaluated, the total size of all mapped attributes must not exceed 4KB.

For OIDC providers, you must supply a custom mapping that includes the google.subject attribute. For example, the following maps the sub claim of the incoming credential to the subject attribute on a Google token:

{"google.subject": "assertion.sub"}

An object containing a list of "key": value pairs. Example: { "name": "wrench", "mass": "1.3kg", "count": "3" }.

attributeCondition

string

A Common Expression Language expression, in plain text, to restrict what otherwise valid authentication credentials issued by the provider should not be accepted.

The expression must output a boolean representing whether to allow the federation.

The following keywords may be referenced in the expressions:

  • assertion: JSON representing the authentication credential issued by the provider.
  • google: The Google attributes mapped from the assertion in the attribute_mappings. google.profile_photo, google.display_name and google.posix_username are not supported.
  • attribute: The custom attributes mapped from the assertion in the attribute_mappings.

The maximum length of the attribute condition expression is 4096 characters. If unspecified, all valid authentication credentials will be accepted.

The following example shows how to only allow credentials with a mapped google.groups value of admins:

"'admins' in google.groups"
expireTime

string (Timestamp format)

Output only. Time after which the workload pool provider will be permanently purged and cannot be recovered.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

extraAttributesOauth2Client

object (ExtraAttributesOAuth2Client)

Optional. The configuration for OAuth 2.0 client used to get the additional user attributes. This should be used when users can't get the desired claims in authentication credentials. Currently this configuration is only supported with OIDC protocol.

Union field provider_config.

provider_config can be only one of the following:

saml

object (Saml)

A SAML identity provider configuration.

oidc

object (Oidc)

An OpenId Connect 1.0 identity provider configuration.

State

The current state of the provider.

Enums
STATE_UNSPECIFIED State unspecified.
ACTIVE The provider is active and may be used to validate authentication credentials.
DELETED The provider is soft-deleted. Soft-deleted providers are permanently deleted after approximately 30 days. You can restore a soft-deleted provider using providers.undelete.

Saml

Represents a SAML identity provider.

JSON representation
{

  // Union field identity_provider can be only one of the following:
  "idpMetadataXml": string
  // End of list of possible types for union field identity_provider.
}
Fields

Union field identity_provider.

identity_provider can be only one of the following:

idpMetadataXml

string

Required. SAML Identity provider configuration metadata xml doc. The xml document should comply with SAML 2.0 specification. The max size of the acceptable xml document will be bounded to 128k characters.

The metadata xml document should satisfy the following constraints: 1) Must contain an Identity Provider Entity ID. 2) Must contain at least one non-expired signing key certificate. 3) For each signing key: a) Valid from should be no more than 7 days from now. b) Valid to should be no more than 15 years in the future. 4) Up to 3 IdP signing keys are allowed in the metadata xml.

When updating the provider's metadata xml, at least one non-expired signing key must overlap with the existing metadata. This requirement is skipped if there are no non-expired signing keys present in the existing metadata.

Oidc

Represents an OpenId Connect 1.0 identity provider.

JSON representation
{
  "issuerUri": string,
  "clientId": string,
  "clientSecret": {
    object (ClientSecret)
  },
  "webSsoConfig": {
    object (WebSsoConfig)
  },
  "jwksJson": string
}
Fields
issuerUri

string

Required. The OIDC issuer URI. Must be a valid URI using the https scheme.

clientId

string

Required. The client ID. Must match the audience claim of the JWT issued by the identity provider.

clientSecret

object (ClientSecret)

The optional client secret. Required to enable Authorization Code flow for web sign-in.

webSsoConfig

object (WebSsoConfig)

Required. Configuration for web single sign-on for the OIDC provider. Here, web sign-in refers to console sign-in and gcloud sign-in through the browser.

jwksJson

string

OIDC JWKs in JSON String format. For details on the definition of a JWK, see https://tools.ietf.org/html/rfc7517. If not set, the jwksUri from the discovery document(fetched from the .well-known path of the issuerUri) will be used. Currently, RSA and EC asymmetric keys are supported. The JWK must use following format and include only the following fields: { "keys": [ { "kty": "RSA/EC", "alg": "", "use": "sig", "kid": "", "n": "", "e": "", "x": "", "y": "", "crv": "" } ] }

ClientSecret

Representation of a client secret configured for the OIDC provider.

JSON representation
{

  // Union field source can be only one of the following:
  "value": {
    object (Value)
  }
  // End of list of possible types for union field source.
}
Fields

Union field source.

source can be only one of the following:

value

object (Value)

The value of the client secret.

Value

Representation of the value of the client secret.

JSON representation
{
  "plainText": string,
  "thumbprint": string
}
Fields
plainText

string

Input only. The plain text of the client secret value. For security reasons, this field is only used for input and will never be populated in any response.

thumbprint

string

Output only. A thumbprint to represent the current client secret value.

WebSsoConfig

Configuration for web single sign-on for the OIDC provider.

JSON representation
{
  "responseType": enum (ResponseType),
  "assertionClaimsBehavior": enum (AssertionClaimsBehavior),
  "additionalScopes": [
    string
  ]
}
Fields
responseType

enum (ResponseType)

Required. The Response Type to request for in the OIDC Authorization Request for web sign-in.

The CODE Response Type is recommended to avoid the Implicit Flow, for security reasons.

assertionClaimsBehavior

enum (AssertionClaimsBehavior)

Required. The behavior for how OIDC Claims are included in the assertion object used for attribute mapping and attribute condition.

additionalScopes[]

string

Additional scopes to request for in the OIDC authentication request on top of scopes requested by default. By default, the openid, profile and email scopes that are supported by the identity provider are requested.

Each additional scope may be at most 256 characters. A maximum of 10 additional scopes may be configured.

ResponseType

Possible Response Types to request for in the OIDC Authorization Request for web sign-in. This determines the OIDC Authentication Flow. See https://openid.net/specs/openid-connect-core-1_0.html#Authentication for a mapping of Response Type to OIDC Authentication Flow.

Enums
RESPONSE_TYPE_UNSPECIFIED No Response Type specified.
CODE The responseType=code selection uses the Authorization Code Flow for web sign-in. Requires a configured client secret.
ID_TOKEN The responseType=id_token selection uses the Implicit Flow for web sign-in.

AssertionClaimsBehavior

Possible behaviors for how OIDC Claims are included in the assertion object used for attribute mapping and attribute condition.

Enums
ASSERTION_CLAIMS_BEHAVIOR_UNSPECIFIED No assertion claims behavior specified.
MERGE_USER_INFO_OVER_ID_TOKEN_CLAIMS Merge the UserInfo Endpoint Claims with ID Token Claims, preferring UserInfo Claim Values for the same Claim Name. This option is available only for the Authorization Code Flow.
ONLY_ID_TOKEN_CLAIMS Only include ID Token Claims.

ExtraAttributesOAuth2Client

Represents the OAuth 2.0 client credential configuration for retrieving additional user attributes that are not present in the initial authentication credentials from the identity provider, e.g. groups. See https://datatracker.ietf.org/doc/html/rfc6749#section-4.4 for more details on client credentials grant flow.

JSON representation
{
  "issuerUri": string,
  "clientId": string,
  "clientSecret": {
    object (ClientSecret)
  },
  "attributesType": enum (AttributesType),
  "queryParameters": {
    object (QueryParameters)
  }
}
Fields
issuerUri

string

Required. The OIDC identity provider's issuer URI. Must be a valid URI using the https scheme. Required to get the OIDC discovery document.

clientId

string

Required. The OAuth 2.0 client ID for retrieving extra attributes from the identity provider. Required to get the Access Token using client credentials grant flow.

clientSecret

object (ClientSecret)

Required. The OAuth 2.0 client secret for retrieving extra attributes from the identity provider. Required to get the Access Token using client credentials grant flow.

attributesType

enum (AttributesType)

Required. Represents the IdP and type of claims that should be fetched.

queryParameters

object (QueryParameters)

Optional. Represents the parameters to control which claims are fetched from an IdP.

AttributesType

Represents the IdP and type of claims that should be fetched.

Enums
ATTRIBUTES_TYPE_UNSPECIFIED No AttributesType specified.
AZURE_AD_GROUPS_MAIL Used to get the user's group claims from the Azure AD identity provider using configuration provided in ExtraAttributesOAuth2Client and mail property of the microsoft.graph.group object is used for claim mapping. See https://learn.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-1.0#properties for more details on microsoft.graph.group properties. The attributes obtained from idntity provider are mapped to assertion.groups.

QueryParameters

Represents the parameters to control which claims are fetched from an IdP.

JSON representation
{
  "filter": string
}
Fields
filter

string

Optional. The filter used to request specific records from IdP. In case of attributes type as AZURE_AD_GROUPS_MAIL, it represents the filter used to request specific groups for users from IdP. By default, all of the groups associated with the user are fetched. The groups should be mail enabled and security enabled. See https://learn.microsoft.com/en-us/graph/search-query-parameter for more details.

Methods

create

Creates a new WorkforcePoolProvider in a WorkforcePool.

delete

Deletes a WorkforcePoolProvider.

get

Gets an individual WorkforcePoolProvider.

list

Lists all non-deleted WorkforcePoolProviders in a WorkforcePool.

patch

Updates an existing WorkforcePoolProvider.

undelete

Undeletes a WorkforcePoolProvider, as long as it was deleted fewer than 30 days ago.