You can let external identity users connect to cluster web interfaces by using Managed Service for Apache Spark [Component Gateway](https://docs.cloud.google.com/managed-spark/docs/concepts/accessing/gateways.md.txt). With this access, users can click links in the Google Cloud console to reach component interfaces hosted on the cluster's first master node.

## Background

[Workforce Identity Federation](https://docs.cloud.google.com/iam/docs/workforce-identity-federation.md.txt) lets
you use an external identity provider (IdP) to authenticate and authorize
workforce employees, partners, and contractors to Google Cloud services.

If Workforce Identity Federation is
[configured in your project](https://docs.cloud.google.com/iam/docs/configuring-workforce-identity-federation.md.txt#configure_workforce_identity_federation),
external identity users can use the Google Cloud console, Google Cloud CLI,
and the Managed Service for Apache Spark API to access most Managed Service for Apache Spark
resources and features, except the following:

- [Managed Service for Apache Spark on GKE](https://docs.cloud.google.com/managed-spark/docs/guides/dpgke/dataproc-gke-overview)
- [Managed Service for Apache Spark Personal Authentication](https://docs.cloud.google.com/managed-spark/docs/concepts/iam/personal-auth.md.txt)
- [Managed Service for Apache Spark Service Account Based Secure Multi-tenancy](https://docs.cloud.google.com/managed-spark/docs/concepts/iam/sa-multi-tenancy.md.txt)
- The **Output** section in the Batch and Job details pages and the **Recommended Alerts** section in the Cluster and Job list pages in the Google Cloud console.

## Use workforce identify federation with the Managed Service for Apache Spark Component Gateway

1. Configure workforce identify federation by following
   the [Configure Workforce Identity Federation](https://docs.cloud.google.com/iam/docs/configuring-workforce-identity-federation.md.txt#configure_workforce_identity_federation)
   guide.

2. Grant external identity users the
   [`dataproc.clusters.use`](https://docs.cloud.google.com/managed-spark/docs/concepts/iam/iam.md.txt#clusters_methods_required_permissions)
   role to allow access the Managed Service for Apache Spark Component Gateway (see
   [Grant IAM roles to principals](https://docs.cloud.google.com/iam/docs/configuring-workforce-identity-federation.md.txt#grant_roles_to_principals)).

   - For instructions on how to represent external identities in IAM policies, see [Represent workforce pool users in IAM
     policies](https://docs.cloud.google.com/iam/docs/configuring-workforce-identity-federation#representing-workforce-users).
3. [Create a Managed Service for Apache Spark cluster with Component Gateway enabled](https://docs.cloud.google.com/managed-spark/docs/concepts/accessing/gateways.md.txt#rest-api).

## Access cluster web interfaces

See [Viewing and Accessing Component Gateway URLs](https://docs.cloud.google.com/managed-spark/docs/concepts/accessing/gateways.md.txt#viewing_and_accessing_component_gateway_urls),
and note the following differences for external identity users:

1. Only users that are authenticated with external identities can access the URL
   for external identities. If a user visits the URL for external identities while
   not logged in, they are redirected to the authentication portal where they
   specify their workforce pool provider name. Next, they are redirected to their
   identity provider to sign in. Then, they are redirected to the component
   web interface.

2. External identities URLs have the following format:

   ```
   https://UNIQUE_ID-dot-dataproc.byoid.googleusercontent.com
   ```

## What's next

- Create a cluster with [Managed Service for Apache Spark components](https://docs.cloud.google.com/managed-spark/docs/concepts/components/overview.md.txt).