Interface AzureWorkloadIdentityRestClient


@Path("/oauth2/v2.0/token") public interface AzureWorkloadIdentityRestClient

Reactive REST client to get access token from Microsoft Entra ID by means of Workload Identity.

Author:
Antonio Tarricone
  • Method Summary

    Modifier and Type
    Method
    Description
    io.smallrye.mutiny.Uni<AccessToken>
    Retrieves an access token for an Azure resource.
    default String
    Retrieve the client assertion from Azure Federated TokenFile.
  • Method Details

    • getAccessToken

      @POST @Consumes("application/x-www-form-urlencoded") @Produces("application/json") @ClientFormParam(name="grant_type",value="client_credentials") @ClientFormParam(name="client_id",value="${AZURE_CLIENT_ID}") @ClientFormParam(name="client_assertion",value="{getClientAssertion}") @ClientFormParam(name="client_assertion_type",value="urn:ietf:params:oauth:client-assertion-type:jwt-bearer") io.smallrye.mutiny.Uni<AccessToken> getAccessToken(@FormParam("scope") String scope)

      Retrieves an access token for an Azure resource.

      Parameters:
      scope - Scope
      Returns:
      AccessToken
    • getClientAssertion

      default String getClientAssertion(String headerName)

      Retrieve the client assertion from Azure Federated TokenFile.

      Parameters:
      headerName - Header to set.
      Returns:
      Value to use to set header.