Class AuthenticationFactoryOAuth2


  • public final class AuthenticationFactoryOAuth2
    extends java.lang.Object
    Factory class that allows to create Authentication instances for OAuth 2.0 authentication methods.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.apache.pulsar.client.api.Authentication clientCredentials​(java.net.URL issuerUrl, java.net.URL credentialsUrl, java.lang.String audience)
      Authenticate with client credentials.
      static org.apache.pulsar.client.api.Authentication clientCredentials​(java.net.URL issuerUrl, java.net.URL credentialsUrl, java.lang.String audience, java.lang.String scope)
      Authenticate with client credentials.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AuthenticationFactoryOAuth2

        public AuthenticationFactoryOAuth2()
    • Method Detail

      • clientCredentials

        public static org.apache.pulsar.client.api.Authentication clientCredentials​(java.net.URL issuerUrl,
                                                                                    java.net.URL credentialsUrl,
                                                                                    java.lang.String audience)
        Authenticate with client credentials.
        Parameters:
        issuerUrl - the issuer URL
        credentialsUrl - the credentials URL
        audience - 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​(java.net.URL issuerUrl,
                                                                                    java.net.URL credentialsUrl,
                                                                                    java.lang.String audience,
                                                                                    java.lang.String scope)
        Authenticate with client credentials.
        Parameters:
        issuerUrl - the issuer URL
        credentialsUrl - the credentials URL
        audience - 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