Class OAuthClientCredentialsFlow

java.lang.Object
org.apache.juneau.rest.auth.oauth.flow.OAuthClientCredentialsFlow

public class OAuthClientCredentialsFlow extends Object
Client-credentials grant (RFC 6749 §4.4) flow helper.

The neutral core performs a single token acquisition and does NOT cache; token caching is layered on top by the caller (e.g. the server-side CachingClientCredentialsFlow decorator or the MCP client's token provider). Supports RFC 8707 resource-indicator binding via OAuthClientCredentialsFlow.Builder.resource(URI).

Usage

var token = OAuthClientCredentialsFlow.create() .tokenEndpoint(URI.create("https://idp.example.com/oauth2/token")) .clientId("worker-service") .clientSecret("...") .scope("read:orders", "write:orders") .build() .acquire();

See Also:
Since:
10.0.0