This document describes how to authenticate to Developer Connect programmatically. How
you authenticate to Developer Connect 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


Developer Connect supports programmatic access. You can access the API in
the following ways:

- [Google Cloud CLI](https://docs.cloud.google.com/developer-connect/docs/authentication#gcloud)
- [REST](https://docs.cloud.google.com/developer-connect/docs/authentication#rest)

### Google Cloud CLI


When you use the [gcloud CLI](https://docs.cloud.google.com/sdk/gcloud/reference) to access
Developer Connect, 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/developer-connect/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 Developer Connect,
see [the gcloud CLI reference pages](https://docs.cloud.google.com/sdk/gcloud/reference).


### REST


You can authenticate to
[the Developer Connect API](https://docs.cloud.google.com/developer-connect/docs/api/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 Developer Connect


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


For more information about the roles for Developer Connect, see
[Access control with IAM](https://docs.cloud.google.com/developer-connect/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).