From c20271cb9941854e46e85a5f975e4fa2aa832fea Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sat, 2 Jan 2016 21:55:53 -0800 Subject: [PATCH] GUACAMOLE-210: Add remaining endpoint properties. --- .../auth/oauth/conf/ConfigurationService.java | 16 ++++++++++++++++ .../oauth/conf/OAuthGuacamoleProperties.java | 11 +++++++++++ 2 files changed, 27 insertions(+) diff --git a/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/oauth/conf/ConfigurationService.java b/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/oauth/conf/ConfigurationService.java index f98721833..e1567d239 100644 --- a/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/oauth/conf/ConfigurationService.java +++ b/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/oauth/conf/ConfigurationService.java @@ -50,6 +50,22 @@ public class ConfigurationService { return environment.getRequiredProperty(OAuthGuacamoleProperties.OAUTH_AUTHORIZATION_ENDPOINT); } + /** + * Returns the token endpoint (URI) of the OAuth service as configured with + * guacamole.properties. + * + * @return + * The token endpoint of the OAuth service, as configured with + * guacamole.properties. + * + * @throws GuacamoleException + * If guacamole.properties cannot be parsed, or if the authorization + * endpoint property is missing. + */ + public String getTokenEndpoint() throws GuacamoleException { + return environment.getRequiredProperty(OAuthGuacamoleProperties.OAUTH_TOKEN_ENDPOINT); + } + /** * Returns the OAuth client ID which should be submitted to the OAuth * service when necessary, as configured with guacamole.properties. This diff --git a/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/oauth/conf/OAuthGuacamoleProperties.java b/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/oauth/conf/OAuthGuacamoleProperties.java index 2098d45b7..0ebb94f3a 100644 --- a/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/oauth/conf/OAuthGuacamoleProperties.java +++ b/extensions/guacamole-auth-openid/src/main/java/org/apache/guacamole/auth/oauth/conf/OAuthGuacamoleProperties.java @@ -44,6 +44,17 @@ public class OAuthGuacamoleProperties { }; + /** + * The token endpoint (URI) of the OAuth service. + */ + public static final StringGuacamoleProperty OAUTH_TOKEN_ENDPOINT = + new StringGuacamoleProperty() { + + @Override + public String getName() { return "oauth-token-endpoint"; } + + }; + /** * OAuth client ID which should be submitted to the OAuth service when * necessary. This value is typically provided by the OAuth service when