<commit_before>---
toc_title: Delegation API
description: Integrate with third-party apps with the delegation API.
---

# Lock Android: Delegation API

After a successful authentication, you can request credentials to access third party apps like Firebase or AWS that are configured in your Auth0 App's Add-On section. In order to do that you need to make a request to our [Delegation API](/auth-api#!#post--delegation) using a valid JWT.

Here's an example
```java
Lock lock = LockContext.getLock(this);
AuthenticationAPIClient client = lock.getAuthenticationAPIClient();
String apiType = "firebase";
String token = .... //Your Auth0 id_token of the logged in User
Map<String, Object> parameters = ParameterBuilder.newEmptyBuilder()
        .set("id_token", token)
        .set("api_type", apiType)
        .asDictionary();
client
    .delegation()
    .addParameters(parameters).start(new BaseCallback<Map<String, Object>>() {
        @Override
        public void onSuccess(Map<String, Object> payload) {
            //Your Firebase token will be in payload        
        }

        @Override
        public void onFailure(Throwable error) {
            //Delegation call failed
        }
    });
```

The only two parameters required are `id_token` and `api_type`, the former is the token returned by Auth0 after a successful authentication, the latter specifies the API credentials we want to retrieve, and these are it's supported values:<commit_msg>Address comments<commit_after>---
toc_title: Delegation API
description: Integrate with third-party apps with the delegation API.
---

# Lock Android: Delegation API

After a successful authentication, you can request credentials to access third party apps like Firebase or AWS that are configured in your Auth0 App's Add-On section. In order to do that you need to make a request to our [Delegation API](/auth-api#!#post--delegation) using a valid JWT.

Here's an example
```java
Lock lock = LockContext.getLock(this);
AuthenticationAPIClient client = lock.getAuthenticationAPIClient();
String apiType = "firebase";
String token = .... //Your Auth0 id_token of the logged in User
Map<String, Object> parameters = ParameterBuilder.newEmptyBuilder()
        .set("id_token", token)
        .set("api_type", apiType)
        .asDictionary();
client
    .delegation()
    .addParameters(parameters).start(new BaseCallback<Map<String, Object>>() {
        @Override
        public void onSuccess(Map<String, Object> payload) {
            //Your Firebase token will be in payload        
        }

        @Override
        public void onFailure(Throwable error) {
            //Delegation call failed
        }
    });
```

> The delegation response is a generic Map since the structure of it will depend of the `api_type` used for delegation

The only two parameters required are `id_token` and `api_type`, the former is the token returned by Auth0 after a successful authentication, the latter specifies the API credentials we want to retrieve, and these are its supported values:
{'fraction_non_alphanumeric': 0.08426596445029624, 'fraction_numerical': 0.0019749835418038184, 'mean_word_length': 3.4955621301775146, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7480462', 'n_tokens_mistral': 791, 'n_tokens_neox': 781, 'n_words': 334}