moved UMA server to its own module

pull/708/merge
Justin Richer 2015-05-12 15:59:03 -04:00
parent 582c52ebf5
commit a2edb31753
23 changed files with 160 additions and 42 deletions

View File

@ -43,10 +43,6 @@
<groupId>org.mitre</groupId>
<artifactId>openid-connect-common</artifactId>
</dependency>
<dependency>
<groupId>org.mitre</groupId>
<artifactId>openid-connect-client</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>

View File

@ -32,10 +32,6 @@ import org.mitre.openid.connect.model.UserInfo;
import org.mitre.openid.connect.service.UserInfoService;
import org.mitre.openid.connect.view.HttpCodeView;
import org.mitre.openid.connect.view.JsonEntityView;
import org.mitre.uma.web.AuthorizationRequestEndpoint;
import org.mitre.uma.web.ClaimsCollectionEndpoint;
import org.mitre.uma.web.PermissionRegistrationEndpoint;
import org.mitre.uma.web.ResourceSetRegistrationEndpoint;
import org.mitre.openid.connect.web.DynamicClientRegistrationEndpoint;
import org.mitre.openid.connect.web.JWKSetPublishingEndpoint;
import org.mitre.openid.connect.web.UserInfoEndpoint;
@ -54,7 +50,6 @@ import org.springframework.web.util.UriComponentsBuilder;
import com.google.common.base.Function;
import com.google.common.base.Strings;
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
import com.nimbusds.jose.Algorithm;
import com.nimbusds.jose.JWSAlgorithm;
@ -365,37 +360,4 @@ public class DiscoveryEndpoint {
}
@RequestMapping(".well-known/uma-configuration")
public String umaConfiguration(Model model) {
Map<String, Object> m = new HashMap<String, Object>();
String issuer = config.getIssuer();
ImmutableSet<String> tokenProfiles = ImmutableSet.of("bearer");
ArrayList<String> grantTypes = Lists.newArrayList("authorization_code", "implicit", "urn:ietf:params:oauth:grant-type:jwt-bearer", "client_credentials", "urn:ietf:params:oauth:grant_type:redelegate");
m.put("version", "1.0");
m.put("issuer", issuer);
m.put("pat_profiles_supported", tokenProfiles);
m.put("aat_profiles_supported", tokenProfiles);
m.put("rpt_profiles_supported", tokenProfiles);
m.put("pat_grant_types_supported", grantTypes);
m.put("aat_grant_types_supported", grantTypes);
m.put("claim_token_profiles_supported", ImmutableSet.of());
m.put("uma_profiles_supported", ImmutableSet.of());
m.put("dynamic_client_endpoint", issuer + DynamicClientRegistrationEndpoint.URL);
m.put("token_endpoint", issuer + "token");
m.put("authorization_endpoint", issuer + "authorize");
m.put("requesting_party_claims_endpoint", issuer + ClaimsCollectionEndpoint.URL);
m.put("introspection_endpoint", issuer + IntrospectionEndpoint.URL);
m.put("resource_set_registration_endpoint", issuer + ResourceSetRegistrationEndpoint.DISCOVERY_URL);
m.put("permission_registration_endpoint", issuer + PermissionRegistrationEndpoint.URL);
m.put("rpt_endpoint", issuer + AuthorizationRequestEndpoint.URL);
model.addAttribute("entity", m);
return JsonEntityView.VIEWNAME;
}
}

View File

@ -41,6 +41,8 @@
<module>openid-connect-client</module>
<module>openid-connect-server</module>
<module>openid-connect-server-webapp</module>
<module>uma-server</module>
<module>uma-server-webapp</module>
</modules>
<scm>

29
uma-server-webapp/pom.xml Normal file
View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015 The MITRE Corporation
and the MIT Kerberos and Internet Trust Consortium
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mitre</groupId>
<artifactId>openid-connect-parent</artifactId>
<version>1.2.0.UMA-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<artifactId>uma-server-webapp</artifactId>
<packaging>war</packaging>
<name>Deployable package of the User Managed Access (UMA) server extension to MITREid Connect</name>
</project>

49
uma-server/pom.xml Normal file
View File

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2015 The MITRE Corporation
and the MIT Kerberos and Internet Trust Consortium
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.mitre</groupId>
<artifactId>openid-connect-parent</artifactId>
<version>1.2.0.UMA-SNAPSHOT</version>
</parent>
<artifactId>uma-server</artifactId>
<name>User Managed Access (UMA) extension of the MITREid Connect server</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java-version}</source>
<target>${java-version}</target>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.mitre</groupId>
<artifactId>openid-connect-server</artifactId>
</dependency>
<dependency>
<groupId>org.mitre</groupId>
<artifactId>openid-connect-client</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,80 @@
/*******************************************************************************
* Copyright 2015 The MITRE Corporation
* and the MIT Kerberos and Internet Trust Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
package org.mitre.uma.web;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import org.mitre.oauth2.web.IntrospectionEndpoint;
import org.mitre.openid.connect.config.ConfigurationPropertiesBean;
import org.mitre.openid.connect.view.JsonEntityView;
import org.mitre.openid.connect.web.DynamicClientRegistrationEndpoint;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Lists;
/**
* @author jricher
*
*/
@Controller
public class UmaDiscoveryEndpoint {
@Autowired
private ConfigurationPropertiesBean config;
@RequestMapping(".well-known/uma-configuration")
public String umaConfiguration(Model model) {
Map<String, Object> m = new HashMap<String, Object>();
String issuer = config.getIssuer();
ImmutableSet<String> tokenProfiles = ImmutableSet.of("bearer");
ArrayList<String> grantTypes = Lists.newArrayList("authorization_code", "implicit", "urn:ietf:params:oauth:grant-type:jwt-bearer", "client_credentials", "urn:ietf:params:oauth:grant_type:redelegate");
m.put("version", "1.0");
m.put("issuer", issuer);
m.put("pat_profiles_supported", tokenProfiles);
m.put("aat_profiles_supported", tokenProfiles);
m.put("rpt_profiles_supported", tokenProfiles);
m.put("pat_grant_types_supported", grantTypes);
m.put("aat_grant_types_supported", grantTypes);
m.put("claim_token_profiles_supported", ImmutableSet.of());
m.put("uma_profiles_supported", ImmutableSet.of());
m.put("dynamic_client_endpoint", issuer + DynamicClientRegistrationEndpoint.URL);
m.put("token_endpoint", issuer + "token");
m.put("authorization_endpoint", issuer + "authorize");
m.put("requesting_party_claims_endpoint", issuer + ClaimsCollectionEndpoint.URL);
m.put("introspection_endpoint", issuer + IntrospectionEndpoint.URL);
m.put("resource_set_registration_endpoint", issuer + ResourceSetRegistrationEndpoint.DISCOVERY_URL);
m.put("permission_registration_endpoint", issuer + PermissionRegistrationEndpoint.URL);
m.put("rpt_endpoint", issuer + AuthorizationRequestEndpoint.URL);
model.addAttribute("entity", m);
return JsonEntityView.VIEWNAME;
}
}