# Retrieving external IDP tokens using Java SDK

**URL:** <https://forum.keycloak.org/t/retrieving-external-idp-tokens-using-java-sdk/26306>\
**Category:** Miscellanaeous\
**Created:** [May 31, 2024, 9:56am UTC](https://forum.keycloak.org/t/retrieving-external-idp-tokens-using-java-sdk/26306 "2024-05-31T09:56:55Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Akshaya.kumar](https://avatars.discourse-cdn.com/v4/letter/a/cab0a1/32.png) [@Akshaya.kumar](https://forum.keycloak.org/u/Akshaya.kumar)\
**Post date:** [May 31, 2024, 9:56am UTC](https://forum.keycloak.org/t/retrieving-external-idp-tokens-using-java-sdk/26306/1 "2024-05-31T09:56:55Z")

</div>

I have been able to successfully retrieve external IDP tokens using the API call `GET /realms/{realm}/broker/{provider_alias}/token HTTP/1.1` with the `Authorization: Bearer <KEYCLOAK ACCESS TOKEN>` header. Now, I would like to know if it is possible to achieve the same functionality through the Java SDK. Can you provide any guidance or examples for this?

[Here is the link to the relevant API documentation](https://access.redhat.com/documentation/en-us/red_hat_build_of_keycloak/22.0/html/server_developer_guide/identity_brokering_apis)
