This document describes how to authenticate to Access Approval programmatically. How
you authenticate to Access Approval depends on the interface you use to access the API
and the environment where your code is running.


For more information about Google Cloud authentication, see the
[Authentication methods](https://docs.cloud.google.com/docs/authentication).

## API access


Access Approval supports programmatic access. You can access the API in
the following ways:

- [Google Cloud CLI](https://docs.cloud.google.com/assured-workloads/access-approval/docs/authentication#gcloud)
- [REST](https://docs.cloud.google.com/assured-workloads/access-approval/docs/authentication#rest)

### Google Cloud CLI


When you use the [gcloud CLI](https://docs.cloud.google.com/sdk/gcloud/reference/access-approval) to access
Access Approval, you authenticate to Google Cloud as a principal, which
provides the credentials used by the gcloud CLI commands.


If your organization's security policies prevent user accounts from having the required
permissions, you can use [service account impersonation](https://docs.cloud.google.com/assured-workloads/access-approval/docs/authentication#sa-impersonation).

For more information, see
[Authenticate for the gcloud CLI](https://docs.cloud.google.com/sdk/docs/authenticate).
For more information about using the gcloud CLI with Access Approval,
see [the gcloud CLI reference pages](https://docs.cloud.google.com/sdk/gcloud/reference/access-approval).


### REST


You can authenticate to
[the Access Approval API](https://docs.cloud.google.com/assured-workloads/access-approval/docs/reference/rest)
by using your [gcloud CLI credentials](https://docs.cloud.google.com/sdk/docs/authenticate) or by
using
[Application Default Credentials](https://docs.cloud.google.com/docs/authentication/application-default-credentials). For more information about authentication for REST
requests, see [Authenticate for using REST](https://docs.cloud.google.com/docs/authentication/rest).

## Access control for Access Approval


After you authenticate to Access Approval, you must be authorized to access
Google Cloud resources. Access Approval uses
Identity and Access Management (IAM) for authorization.


For more information about the roles for Access Approval, see
[Access control with IAM](https://docs.cloud.google.com/assured-workloads/access-approval/docs/access-control).
For more information about IAM and authorization, see
[IAM overview](https://docs.cloud.google.com/iam/docs/overview).

## What's next

- Learn about [Google Cloud authentication methods](https://docs.cloud.google.com/docs/authentication#auth-decision-tree).
- See a list of [authentication use cases](https://docs.cloud.google.com/docs/authentication/use-cases).