---
title: "Auth"
description: "Auth"
url: "https://www.contentstack.com/docs/developers/sdks/marketplace-sdk/java/reference/auth"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-13"
---

# Auth

## Auth

While authorizing a Contentstack App, the app requests permissions from the user to perform a set of operations on behalf of the user. The app receives an access token after a user authenticates and authorizes access, then passes it as a credential when it calls the Contentstack APIs.

The Auth class handles user-requested permissions, allowing users to either request for the permission or, once their task is finished, request permission revocations.

**Example:**

```
Auth auth = marketplace.authorizations().addParam("param1", "value1").addHeader("authtoken", ORG_UID);
```

## findAuthorizedApp

The findAuthorizedApp method returns a call to retrieve authorized apps.

```
Example:
Call<ResponseBody> request = auth.findAuthorizedApp().execute();
```

## addParam

The addParam method adds a header with the specified key and value

**Specified by:**

**addParam** in interface **BaseImplementation**

```
Throws:
NullPointerException - if the key or value argument is null
Example:
Marketplace marketplace = new Marketplace.Builder("ORGANIZATION_UID") .host("marketplace.contentstack.io").build(); 
Auth authorizations = marketplace.authorizations(); 
authorizations.addParam("param1", "value1");
```

The key of the header to be added

The value of the header to be added

## addHeader

The addHeader adds a header with the specified key and value.

**Specified by:**

**addHeader** provides support to add custom header to the request

```
Throws:
NullPointerException - if the key or value argument is null
Example:
Marketplace marketplace = new Marketplace.Builder("ORGANIZATION_UID") .host("marketplace.contentstack.io").build(); 
Auth authorizations = marketplace.authorizations(); 
authorizations.addHeader("key", "value");
```

The key of the header to be added

The value of the header to be added

## addParams

The addParams method adds the specified parameters.

**Specified by:**

**addParams** in interface **BaseImplementation**

```
Throws:
NullPointerException - if the params argument is null
Example:
Marketplace marketplace = new Marketplace.Builder("ORGANIZATION_UID") .host("marketplace.contentstack.io").build(); 
Auth authorizations = marketplace.authorizations(); 
HashMap params = new HashMap(); 
authorizations.addParams(params);
```

The parameters to be added

## addHeaders

The addHeaders method adds the specified parameters.

**Specified by:**

**addHeaders** in interface **BaseImplementation**

```
Throws:
NullPointerException - if the params argument is null
Example:
Marketplace marketplace = new Marketplace.Builder("ORGANIZATION_UID") .host("api.contentstack.io").build(); 
Auth authorizations = marketplace.authorizations(); 
HashMap params = new HashMap(); 
authorizations.addHeaders(params);
```

The parameters to be added

UID of the organization

## Auth | Java Marketplace SDK | Contentstack

Auth handles authentication and authorization queries for apps in the Contentstack Java Marketplace SDK.