Package com.ngrok

Class Http.OAuth

  • Enclosing interface:
    Http

    public static class Http.OAuth
    extends Object
    Represents OAuth configuration for an HTTP listener.
    See Also:
    OAuth in the ngrok docs for additional details.
    • Constructor Detail

      • OAuth

        public OAuth​(String provider)
        Constructs new OAuth configuration with the specified provider.
        Parameters:
        provider - the provider for OAuth
    • Method Detail

      • client

        public Http.OAuth client​(String id,
                                 String secret)
        Sets the client ID and client secret for OAuth.
        Parameters:
        id - the client ID for the OAuth
        secret - the client secret for the OAuth
        Returns:
        this OAuth object
      • allowEmail

        public Http.OAuth allowEmail​(String email)
        Sets the email address allowed by OAuth.
        Parameters:
        email - the email address allowed by OAuth
        Returns:
        this OAuth object
      • allowDomain

        public Http.OAuth allowDomain​(String domain)
        Sets the domain allowed by the OAuth.
        Parameters:
        domain - the domain allowed by OAuth
        Returns:
        this OAuth object
      • scope

        public Http.OAuth scope​(String scope)
        Sets the scope for OAuth.
        Parameters:
        scope - the scope for OAuth
        Returns:
        this OAuth object
      • getProvider

        public String getProvider()
        Returns the OAuth provider.
        Returns:
        the provider
      • hasClientConfigured

        public boolean hasClientConfigured()
        Returns of client ID and secret have been configured for OAuth
        Returns:
        true if both client ID and secret has been set, false otherwise
      • getClientId

        public String getClientId()
        Returns the client ID for OAuth.
        Returns:
        the client ID
      • getClientSecret

        public String getClientSecret()
        Returns the client secret for OAuth.
        Returns:
        the client secret
      • getAllowEmails

        public List<String> getAllowEmails()
        Returns the email address to be allowed by OAuth.
        Returns:
        the email address
      • getAllowDomains

        public List<String> getAllowDomains()
        Returns the domain to be allowed by OAuth.
        Returns:
        the domain
      • getScopes

        public List<String> getScopes()
        Returns the scope to be used by OAuth.
        Returns:
        the scope