Class STS
- All Implemented Interfaces:
Closeable, AutoCloseable
The STS exchanges OpenID Connect (OIDC) ID tokens - issued by trusted OIDC providers - for Equinix access tokens (RFC 8693 token exchange), and manages the trust relationships and discovery metadata that underpin that exchange:
tokens()- the OAuth 2.0 token exchange (POST /v1/token) and the granted-access-policy listing (POST /v1/accessPoliciesGranted).oidcProviders()- registration and lifecycle (create / page / patch / delete / suspend / resume) of trusted OIDC providers within a root project.discovery()- the unauthenticated discovery endpoints: the JSON Web Key Set (GET /jwks) and the OpenID Connect discovery document (GET /.well-known/openid-configuration).
Each accessor uses lazy initialization - the internal client is created on first access and reused for subsequent calls.
Service host and authentication
STS requests go to the service's own host, https://sts.eqix.equinix.com, declared as
the hostName of the STS functional area in apiParams_STS.json. The unified
gateway https://api.equinix.com answers 404 for every STS path. The OAuth client-credentials
login (when one is needed) still goes to api.equinix.com. Override the host with
getEquinixClient().setDomainEndPoint("STS", ...).
The token exchange, granted-access-policy listing, JWKS and OpenID discovery endpoints are
unauthenticated in the specification: they never trigger an Equinix login and are sent without a
bearer header. A workload that holds only an OIDC ID token can therefore use
withoutCredentials(); OIDC-provider management still needs Equinix credentials.
Quick Start
BasicEquinixCredentials credentials = new BasicEquinixCredentials("clientId", "clientSecret");
STS sts = new STS(credentials);
StsToken token = sts.tokens().generate(new TokenRequest()
.grantType("urn:ietf:params:oauth:grant-type:token-exchange")
.subjectToken(idToken)
.subjectTokenType("urn:ietf:params:oauth:token-type:id_token")
.scope(StsScope.projectPolicies("abc-123")));
// Workload identity federation: no Equinix client secret needed for the exchange itself.
StsToken federated = STS.withoutCredentials().tokens().generate(request);
- Author:
- ianjones
- See Also:
-
Field Summary
Fields inherited from class EquinixClient
autoLoadMetros, enrichMetroRegistry, equinixClient, peeringDbApiKeyModifier and TypeFieldDescriptionprotected final booleanWhether an explicitEquinixClient.authenticate()should eagerly load the metro catalog.protected final booleanWhether the metro registry should be enriched with per-IBX detail from EIA.protected final EquinixClientprotected final StringThe PeeringDB API key configured viaEquinixConfig.getPeeringDbApiKey(), ornullwhen none was configured. -
Constructor Summary
ConstructorsConstructorDescriptionSTS(EquinixCredentials equinixCredentials) Creates a new STS client using the provided credentials.STS(EquinixCredentials equinixCredentials, boolean isSandBoxed) Creates a new STS client with optional sandbox mode.STS(EquinixCredentialsProvider credentialsProvider) Creates a new STS client whose credentials are resolved through the given provider.STS(EquinixCredentialsProvider credentialsProvider, boolean isSandBoxed) Creates a new STS client over a custom credentials provider, with optional sandbox mode.STS(EquinixCredentialsProvider credentialsProvider, EquinixConfig config) Creates a new STS client over a custom credentials provider with explicitEquinixConfigoptions.STS(EquinixCredentials equinixCredentials, EquinixConfig config) Creates a new STS client with explicitEquinixConfigoptions. -
Method Summary
Modifier and TypeMethodDescriptionReturns the client for the STS unauthenticated discovery endpoints - the JSON Web Key Set (GET /jwks) and the OpenID Connect discovery document (GET /.well-known/openid-configuration).Returns the client for managing trusted OIDC providers within a root project (/v1/projects/{projectId}/oidcProviders).tokens()Returns the client for the STS OAuth 2.0 token exchange (POST /v1/token) and the granted-access-policy listing (POST /v1/accessPoliciesGranted).static STSCreates an STS client with no Equinix credentials, for workload identity federation: the token exchange (tokens()) and discovery (discovery()) work without a login.Methods inherited from class EquinixClient
authenticate, close, coreModifier and TypeMethodDescriptionvoidExplicitly obtains a token from the configured source (an OAuth2 client-credentials mint, or theBearerTokenProvider) and stores it for subsequent API calls.voidclose()protected Corecore()Returns the internal core client for authentication and platform-level operations.
-
Constructor Details
-
STS
Creates a new STS client using the provided credentials. Authentication occurs automatically on the first API call.- Parameters:
equinixCredentials- the OAuth2 credentials for authenticating with Equinix APIs
-
STS
Creates a new STS client with optional sandbox mode.- Parameters:
equinixCredentials- the OAuth2 credentials for authenticating with Equinix APIsisSandBoxed-trueto use the sandbox environment for testing;falsefor production
-
STS
Creates a new STS client whose credentials are resolved through the given provider. Authentication occurs automatically on the first API call.- Parameters:
credentialsProvider- supplies the OAuth2 credentials for authenticating with Equinix APIs
-
STS
Creates a new STS client over a custom credentials provider, with optional sandbox mode.- Parameters:
credentialsProvider- supplies the OAuth2 credentials for authenticating with Equinix APIsisSandBoxed-trueto use the sandbox environment for testing;falsefor production
-
STS
Creates a new STS client with explicitEquinixConfigoptions.- Parameters:
equinixCredentials- the OAuth2 credentials for authenticating with Equinix APIsconfig- the construction-time options
-
STS
Creates a new STS client over a custom credentials provider with explicitEquinixConfigoptions.- Parameters:
credentialsProvider- supplies the OAuth2 credentials for authenticating with Equinix APIsconfig- the construction-time options
-
-
Method Details
-
withoutCredentials
Creates an STS client with no Equinix credentials, for workload identity federation: the token exchange (tokens()) and discovery (discovery()) work without a login. Calling an operation that needs an Equinix bearer token (theoidcProviders()management API) fails with anEquinixClientExceptionnaming the missing credentials.- Returns:
- a credential-less STS client targeting production
-
tokens
-
oidcProviders
Returns the client for managing trusted OIDC providers within a root project (/v1/projects/{projectId}/oidcProviders).- Returns:
- the
STSOidcProvidersclient
-
discovery
Returns the client for the STS unauthenticated discovery endpoints - the JSON Web Key Set (GET /jwks) and the OpenID Connect discovery document (GET /.well-known/openid-configuration).- Returns:
- the
STSDiscoveryclient
-