Skip to content

Commit

Permalink
get token endpoint from resource configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelwechner committed Nov 5, 2017
1 parent c11ecfb commit cb3bc57
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -76,7 +76,7 @@ public View getView(String viewId) throws Exception {
throw new Exception("Checking 'state' parameter failed!");
}

String token_endpoint = getDiscoveryDocument();
String token_endpoint = getTokenEndpoint();
String code = getEnvironment().getRequest().getParameter("code");
String id_token = getAccessAndIdToken(token_endpoint, code);
if (id_token == null) {
Expand Down Expand Up @@ -191,10 +191,10 @@ private void addUserToGroups(User user) throws Exception {
/**
* @return URL of token endpoint
*/
private String getDiscoveryDocument() {
private String getTokenEndpoint() throws Exception {
// TODO: Make URL configurable and depending on provider, e.g. Google OpenID is using https://accounts.google.com/.well-known/openid-configuration
log.warn("TODO: Get token endpoint URL from discovery document!");
return "https://www.googleapis.com/oauth2/v4/token"; // TODO: Get URL from discovery document
return getResourceConfigProperty("token_endpoint_url");
}

/**
Expand Down

0 comments on commit cb3bc57

Please sign in to comment.