Package com.ngrok
Class Http.OAuth
- java.lang.Object
-
- com.ngrok.Http.OAuth
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Http.OAuth
allowDomain(String domain)
Sets the domain allowed by the OAuth.Http.OAuth
allowEmail(String email)
Sets the email address allowed by OAuth.Http.OAuth
client(String id, String secret)
Sets the client ID and client secret for OAuth.List<String>
getAllowDomains()
Returns the domain to be allowed by OAuth.List<String>
getAllowEmails()
Returns the email address to be allowed by OAuth.String
getClientId()
Returns the client ID for OAuth.String
getClientSecret()
Returns the client secret for OAuth.String
getProvider()
Returns the OAuth provider.List<String>
getScopes()
Returns the scope to be used by OAuth.boolean
hasClientConfigured()
Returns of client ID and secret have been configured for OAuthHttp.OAuth
scope(String scope)
Sets the scope for OAuth.
-
-
-
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 OAuthsecret
- 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
-
-