Class ImmutableAuthorizationProvider

    • Constructor Detail

      • ImmutableAuthorizationProvider

        public ImmutableAuthorizationProvider​(String authorization)
    • Method Detail

      • fromAppInstallationToken

        public static AuthorizationProvider fromAppInstallationToken​(String appInstallationToken)
        Builds and returns a AuthorizationProvider from a given App Installation Token
        Parameters:
        appInstallationToken - A string containing the GitHub App installation token
        Returns:
        the configured Builder from given GitHub App installation token.
      • fromLoginAndPassword

        @Deprecated
        public static AuthorizationProvider fromLoginAndPassword​(String login,
                                                                 String password)
        Deprecated.
        Login with password credentials are no longer supported by GitHub
        Builds and returns a AuthorizationProvider from the given user/password pair
        Parameters:
        login - The login for the user, usually the same as the username
        password - The password for the associated user
        Returns:
        a correctly configured AuthorizationProvider that will always return the credentials for the same user and password combo
      • getEncodedAuthorization

        public String getEncodedAuthorization()
        Description copied from interface: AuthorizationProvider
        Returns the credentials to be used with a given request. As an example, a authorization provider for a bearer token will return something like:
         
          @Override
          public String getEncodedAuthorization() {
          return "Bearer myBearerToken";
          }
         
         
        Specified by:
        getEncodedAuthorization in interface AuthorizationProvider
        Returns:
        encoded authorization string, can be null