Class AuthenticationFactoryOAuth2
java.lang.Object
org.apache.pulsar.client.impl.auth.oauth2.AuthenticationFactoryOAuth2
Factory class that allows to create
Authentication instances
for OAuth 2.0 authentication methods.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.pulsar.client.api.AuthenticationclientCredentials(URL issuerUrl, URL credentialsUrl, String audience) Authenticate with client credentials.static org.apache.pulsar.client.api.AuthenticationclientCredentials(URL issuerUrl, URL credentialsUrl, String audience, String scope) Authenticate with client credentials.
-
Constructor Details
-
AuthenticationFactoryOAuth2
public AuthenticationFactoryOAuth2()
-
-
Method Details
-
clientCredentials
public static org.apache.pulsar.client.api.Authentication clientCredentials(URL issuerUrl, URL credentialsUrl, String audience) Authenticate with client credentials.- Parameters:
issuerUrl- the issuer URLcredentialsUrl- the credentials URLaudience- An optional field. The audience identifier used by some Identity Providers, like Auth0.- Returns:
- an Authentication object
-
clientCredentials
public static org.apache.pulsar.client.api.Authentication clientCredentials(URL issuerUrl, URL credentialsUrl, String audience, String scope) Authenticate with client credentials.- Parameters:
issuerUrl- the issuer URLcredentialsUrl- the credentials URLaudience- An optional field. The audience identifier used by some Identity Providers, like Auth0.scope- An optional field. The value of the scope parameter is expressed as a list of space-delimited, case-sensitive strings. The strings are defined by the authorization server. If the value contains multiple space-delimited strings, their order does not matter, and each string adds an additional access range to the requested scope. From here: https://datatracker.ietf.org/doc/html/rfc6749#section-4.4.2- Returns:
- an Authentication object
-