diff --git a/openid-connect-client/.classpath b/openid-connect-client/.classpath index 1b28ee5d7..bf96ac098 100644 --- a/openid-connect-client/.classpath +++ b/openid-connect-client/.classpath @@ -1,6 +1,9 @@ + + + diff --git a/openid-connect-client/.settings/org.eclipse.wst.common.component b/openid-connect-client/.settings/org.eclipse.wst.common.component index 0bd13354a..24ebd11e7 100755 --- a/openid-connect-client/.settings/org.eclipse.wst.common.component +++ b/openid-connect-client/.settings/org.eclipse.wst.common.component @@ -1,6 +1,9 @@ - - - - - - + + + + + + + + + diff --git a/openid-connect-client/src/main/java/org/mitre/openid/connect/client/OpenIdConnectAuthenticationFilter.java b/openid-connect-client/src/main/java/org/mitre/openid/connect/client/OpenIdConnectAuthenticationFilter.java index 9fa2b2cf4..5508a0a63 100644 --- a/openid-connect-client/src/main/java/org/mitre/openid/connect/client/OpenIdConnectAuthenticationFilter.java +++ b/openid-connect-client/src/main/java/org/mitre/openid/connect/client/OpenIdConnectAuthenticationFilter.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.client; import java.io.IOException; diff --git a/openid-connect-client/src/main/java/org/mitre/openid/connect/client/OpenIdConnectAuthenticationProvider.java b/openid-connect-client/src/main/java/org/mitre/openid/connect/client/OpenIdConnectAuthenticationProvider.java index d94937ae5..9454a2a72 100644 --- a/openid-connect-client/src/main/java/org/mitre/openid/connect/client/OpenIdConnectAuthenticationProvider.java +++ b/openid-connect-client/src/main/java/org/mitre/openid/connect/client/OpenIdConnectAuthenticationProvider.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.client; import org.springframework.beans.factory.InitializingBean; diff --git a/openid-connect-client/src/main/java/org/mitre/openid/connect/client/OpenIdConnectAuthenticationToken.java b/openid-connect-client/src/main/java/org/mitre/openid/connect/client/OpenIdConnectAuthenticationToken.java index 4e515f565..2f62753d0 100644 --- a/openid-connect-client/src/main/java/org/mitre/openid/connect/client/OpenIdConnectAuthenticationToken.java +++ b/openid-connect-client/src/main/java/org/mitre/openid/connect/client/OpenIdConnectAuthenticationToken.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.client; import java.util.ArrayList; diff --git a/openid-connect-common/.classpath b/openid-connect-common/.classpath index 1b28ee5d7..bf96ac098 100644 --- a/openid-connect-common/.classpath +++ b/openid-connect-common/.classpath @@ -1,6 +1,9 @@ + + + diff --git a/openid-connect-common/.settings/org.eclipse.wst.common.component b/openid-connect-common/.settings/org.eclipse.wst.common.component index 1e24c2b7c..4a3e4abda 100644 --- a/openid-connect-common/.settings/org.eclipse.wst.common.component +++ b/openid-connect-common/.settings/org.eclipse.wst.common.component @@ -2,5 +2,6 @@ + diff --git a/openid-connect-server/src/main/java/org/mitre/jdbc/datasource/H2DataSourceFactory.java b/openid-connect-common/src/main/java/org/mitre/jdbc/datasource/H2DataSourceFactory.java similarity index 92% rename from openid-connect-server/src/main/java/org/mitre/jdbc/datasource/H2DataSourceFactory.java rename to openid-connect-common/src/main/java/org/mitre/jdbc/datasource/H2DataSourceFactory.java index e312a2a99..e8e4bf435 100644 --- a/openid-connect-server/src/main/java/org/mitre/jdbc/datasource/H2DataSourceFactory.java +++ b/openid-connect-common/src/main/java/org/mitre/jdbc/datasource/H2DataSourceFactory.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jdbc.datasource; import java.io.IOException; diff --git a/openid-connect-server/src/main/java/org/mitre/jdbc/datasource/util/SqlFileParser.java b/openid-connect-common/src/main/java/org/mitre/jdbc/datasource/util/SqlFileParser.java similarity index 84% rename from openid-connect-server/src/main/java/org/mitre/jdbc/datasource/util/SqlFileParser.java rename to openid-connect-common/src/main/java/org/mitre/jdbc/datasource/util/SqlFileParser.java index b518ace5a..131cdd2e2 100644 --- a/openid-connect-server/src/main/java/org/mitre/jdbc/datasource/util/SqlFileParser.java +++ b/openid-connect-common/src/main/java/org/mitre/jdbc/datasource/util/SqlFileParser.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jdbc.datasource.util; import java.io.BufferedReader; @@ -146,4 +161,4 @@ public class SqlFileParser { Matcher match = WORD_PATTERN.matcher(line); return match.find() ? match.group(1) : null; } -} \ No newline at end of file +} diff --git a/openid-connect-common/src/main/java/org/mitre/jwt/model/ClaimSet.java b/openid-connect-common/src/main/java/org/mitre/jwt/model/ClaimSet.java index 8eeeb7bfc..513d78594 100644 --- a/openid-connect-common/src/main/java/org/mitre/jwt/model/ClaimSet.java +++ b/openid-connect-common/src/main/java/org/mitre/jwt/model/ClaimSet.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.model; import java.io.ByteArrayInputStream; diff --git a/openid-connect-common/src/main/java/org/mitre/jwt/model/Jwt.java b/openid-connect-common/src/main/java/org/mitre/jwt/model/Jwt.java index c6a4e7a33..39d609bf3 100644 --- a/openid-connect-common/src/main/java/org/mitre/jwt/model/Jwt.java +++ b/openid-connect-common/src/main/java/org/mitre/jwt/model/Jwt.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.model; import java.util.List; diff --git a/openid-connect-common/src/main/java/org/mitre/jwt/model/JwtClaims.java b/openid-connect-common/src/main/java/org/mitre/jwt/model/JwtClaims.java index eacc25c4f..0c4807baf 100644 --- a/openid-connect-common/src/main/java/org/mitre/jwt/model/JwtClaims.java +++ b/openid-connect-common/src/main/java/org/mitre/jwt/model/JwtClaims.java @@ -1,204 +1,219 @@ -package org.mitre.jwt.model; - -import java.text.DateFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; - -public class JwtClaims extends ClaimSet { - - public static final String TYPE = "typ"; - public static final String JWT_ID = "jti"; - public static final String PRINCIPAL = "prn"; - public static final String AUDIENCE = "aud"; - public static final String ISSUER = "iss"; - public static final String ISSUED_AT = "iat"; - public static final String NOT_BEFORE = "nbf"; - public static final String EXPIRATION = "exp"; - public static final String NONCE = "nonce"; - - /** - * ISO8601 / RFC3339 Date Format - */ - //public static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz"); - - public JwtClaims() { - super(); - } - - public JwtClaims(JsonObject json) { - super(json); - } - - public JwtClaims(String b64) { - super(b64); - } - - @Override - public void loadFromJsonObject(JsonObject json) { - JsonObject pass = new JsonObject(); - - for (Entry element : json.entrySet()) { - if (element.getValue().isJsonNull()) { - pass.add(element.getKey(), element.getValue()); - } else if (element.getKey().equals(EXPIRATION)) { - setExpiration(new Date(element.getValue().getAsLong() * 1000L)); - } else if (element.getKey().equals(NOT_BEFORE)) { - setNotBefore(new Date(element.getValue().getAsLong() * 1000L)); - } else if (element.getKey().equals(ISSUED_AT)) { - setIssuedAt(new Date(element.getValue().getAsLong() * 1000L)); - } else if (element.getKey().equals(ISSUER)) { - setIssuer(element.getValue().getAsString()); - } else if (element.getKey().equals(AUDIENCE)) { - setAudience(element.getValue().getAsString()); - } else if (element.getKey().equals(PRINCIPAL)) { - setPrincipal(element.getValue().getAsString()); - } else if (element.getKey().equals(JWT_ID)) { - setJwtId(element.getValue().getAsString()); - } else if (element.getKey().equals(TYPE)) { - setType(element.getValue().getAsString()); - } else if (element.getKey().equals(NONCE)){ - setType(element.getValue().getAsString()); - }else { - pass.add(element.getKey(), element.getValue()); - } - } - - // load all the generic claims into this object - super.loadFromJsonObject(pass); - } - - /** - * @return the expiration - */ - public Date getExpiration() { - return getClaimAsDate(EXPIRATION); - } - - /** - * @param expiration the expiration to set - */ - public void setExpiration(Date expiration) { - setClaim(EXPIRATION, expiration); - } - - /** - * @return the notBefore - */ - public Date getNotBefore() { - return getClaimAsDate(NOT_BEFORE); - } - - /** - * @param notBefore the notBefore to set - */ - public void setNotBefore(Date notBefore) { - setClaim(NOT_BEFORE, notBefore); - } - - /** - * @return the issuedAt - */ - public Date getIssuedAt() { - return getClaimAsDate(ISSUED_AT); - } - - /** - * @param issuedAt the issuedAt to set - */ - public void setIssuedAt(Date issuedAt) { - setClaim(ISSUED_AT, issuedAt); - } - - /** - * @return the issuer - */ - public String getIssuer() { - return getClaimAsString(ISSUER); - } - - /** - * @param issuer the issuer to set - */ - public void setIssuer(String issuer) { - setClaim(ISSUER, issuer); - } - - /** - * @return the audience - */ - public String getAudience() { - return getClaimAsString(AUDIENCE); - } - - /** - * @param audience the audience to set - */ - public void setAudience(String audience) { - setClaim(AUDIENCE, audience); - } - - /** - * @return the principal - */ - public String getPrincipal() { - return getClaimAsString(PRINCIPAL); - } - - /** - * @param principal the principal to set - */ - public void setPrincipal(String principal) { - setClaim(AUDIENCE, principal); - } - - /** - * @return the jwtId - */ - public String getJwtId() { - return getClaimAsString(JWT_ID); - } - - /** - * @param jwtId the jwtId to set - */ - public void setJwtId(String jwtId) { - setClaim(JWT_ID, jwtId); - } - - /** - * @return the type - */ - public String getType() { - return getClaimAsString(TYPE); - } - - /** - * @param type the type to set - */ - public void setType(String type) { - setClaim(TYPE, type); - } - - /** - * @return the nonce - */ - public String getNonce() { - return getClaimAsString(NONCE); - } - - /** - * @param nonce the nonce to set - */ - public void setNonce(String nonce) { - setClaim(NONCE, nonce); - } - -} +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.model; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; + +public class JwtClaims extends ClaimSet { + + public static final String TYPE = "typ"; + public static final String JWT_ID = "jti"; + public static final String PRINCIPAL = "prn"; + public static final String AUDIENCE = "aud"; + public static final String ISSUER = "iss"; + public static final String ISSUED_AT = "iat"; + public static final String NOT_BEFORE = "nbf"; + public static final String EXPIRATION = "exp"; + public static final String NONCE = "nonce"; + + /** + * ISO8601 / RFC3339 Date Format + */ + //public static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz"); + + public JwtClaims() { + super(); + } + + public JwtClaims(JsonObject json) { + super(json); + } + + public JwtClaims(String b64) { + super(b64); + } + + @Override + public void loadFromJsonObject(JsonObject json) { + JsonObject pass = new JsonObject(); + + for (Entry element : json.entrySet()) { + if (element.getValue().isJsonNull()) { + pass.add(element.getKey(), element.getValue()); + } else if (element.getKey().equals(EXPIRATION)) { + setExpiration(new Date(element.getValue().getAsLong() * 1000L)); + } else if (element.getKey().equals(NOT_BEFORE)) { + setNotBefore(new Date(element.getValue().getAsLong() * 1000L)); + } else if (element.getKey().equals(ISSUED_AT)) { + setIssuedAt(new Date(element.getValue().getAsLong() * 1000L)); + } else if (element.getKey().equals(ISSUER)) { + setIssuer(element.getValue().getAsString()); + } else if (element.getKey().equals(AUDIENCE)) { + setAudience(element.getValue().getAsString()); + } else if (element.getKey().equals(PRINCIPAL)) { + setPrincipal(element.getValue().getAsString()); + } else if (element.getKey().equals(JWT_ID)) { + setJwtId(element.getValue().getAsString()); + } else if (element.getKey().equals(TYPE)) { + setType(element.getValue().getAsString()); + } else if (element.getKey().equals(NONCE)){ + setType(element.getValue().getAsString()); + }else { + pass.add(element.getKey(), element.getValue()); + } + } + + // load all the generic claims into this object + super.loadFromJsonObject(pass); + } + + /** + * @return the expiration + */ + public Date getExpiration() { + return getClaimAsDate(EXPIRATION); + } + + /** + * @param expiration the expiration to set + */ + public void setExpiration(Date expiration) { + setClaim(EXPIRATION, expiration); + } + + /** + * @return the notBefore + */ + public Date getNotBefore() { + return getClaimAsDate(NOT_BEFORE); + } + + /** + * @param notBefore the notBefore to set + */ + public void setNotBefore(Date notBefore) { + setClaim(NOT_BEFORE, notBefore); + } + + /** + * @return the issuedAt + */ + public Date getIssuedAt() { + return getClaimAsDate(ISSUED_AT); + } + + /** + * @param issuedAt the issuedAt to set + */ + public void setIssuedAt(Date issuedAt) { + setClaim(ISSUED_AT, issuedAt); + } + + /** + * @return the issuer + */ + public String getIssuer() { + return getClaimAsString(ISSUER); + } + + /** + * @param issuer the issuer to set + */ + public void setIssuer(String issuer) { + setClaim(ISSUER, issuer); + } + + /** + * @return the audience + */ + public String getAudience() { + return getClaimAsString(AUDIENCE); + } + + /** + * @param audience the audience to set + */ + public void setAudience(String audience) { + setClaim(AUDIENCE, audience); + } + + /** + * @return the principal + */ + public String getPrincipal() { + return getClaimAsString(PRINCIPAL); + } + + /** + * @param principal the principal to set + */ + public void setPrincipal(String principal) { + setClaim(AUDIENCE, principal); + } + + /** + * @return the jwtId + */ + public String getJwtId() { + return getClaimAsString(JWT_ID); + } + + /** + * @param jwtId the jwtId to set + */ + public void setJwtId(String jwtId) { + setClaim(JWT_ID, jwtId); + } + + /** + * @return the type + */ + public String getType() { + return getClaimAsString(TYPE); + } + + /** + * @param type the type to set + */ + public void setType(String type) { + setClaim(TYPE, type); + } + + /** + * @return the nonce + */ + public String getNonce() { + return getClaimAsString(NONCE); + } + + /** + * @param nonce the nonce to set + */ + public void setNonce(String nonce) { + setClaim(NONCE, nonce); + } + +} diff --git a/openid-connect-common/src/main/java/org/mitre/jwt/model/JwtHeader.java b/openid-connect-common/src/main/java/org/mitre/jwt/model/JwtHeader.java index ca0aae931..215537298 100644 --- a/openid-connect-common/src/main/java/org/mitre/jwt/model/JwtHeader.java +++ b/openid-connect-common/src/main/java/org/mitre/jwt/model/JwtHeader.java @@ -1,110 +1,125 @@ -package org.mitre.jwt.model; - -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; - -public class JwtHeader extends ClaimSet { - - public static final String TYPE = "typ"; - public static final String ALGORITHM = "alg"; - public static final String ENCRYPTION_METHOD = "enc"; - - /** - * Make an empty header - */ - public JwtHeader() { - super(); - } - - /** - * Build a header from a JSON object - * @param json - */ - public JwtHeader(JsonObject json) { - super(json); - } - - - public JwtHeader(String b64) { - super(b64); - } - - /** - * Load all claims from the given json object into this object - */ - @Override - public void loadFromJsonObject(JsonObject json) { - - JsonObject pass = new JsonObject(); - - for (Entry element : json.entrySet()) { - if (element.getValue().isJsonNull()) { - pass.add(element.getKey(), element.getValue()); - } else if (element.getKey().equals(TYPE)) { - this.setType(json.get(TYPE).getAsString()); - } else if (element.getKey().equals(ALGORITHM)) { - this.setAlgorithm(json.get(ALGORITHM).getAsString()); - } else if (element.getKey().equals(ENCRYPTION_METHOD)) { - this.setEncryptionMethod(json.get(ENCRYPTION_METHOD).getAsString()); - } else { - pass.add(element.getKey(), element.getValue()); - } - } - - // now load all the ones we didn't handle specially - super.loadFromJsonObject(pass); - } - - /** - * @return the type - */ - public String getType() { - return getClaimAsString(TYPE); - } - - - /** - * @param type the type to set - */ - public void setType(String type) { - setClaim(TYPE, type); - } - - - /** - * @return the algorithm - */ - public String getAlgorithm() { - return getClaimAsString(ALGORITHM); - } - - - /** - * @param algorithm the algorithm to set - */ - public void setAlgorithm(String algorithm) { - setClaim(ALGORITHM, algorithm); - } - - - /** - * @return the encryptionMethod - */ - public String getEncryptionMethod() { - return getClaimAsString(ENCRYPTION_METHOD); - } - - - /** - * @param encryptionMethod the encryptionMethod to set - */ - public void setEncryptionMethod(String encryptionMethod) { - setClaim(ENCRYPTION_METHOD, encryptionMethod); - } - -} +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.model; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; + +public class JwtHeader extends ClaimSet { + + public static final String TYPE = "typ"; + public static final String ALGORITHM = "alg"; + public static final String ENCRYPTION_METHOD = "enc"; + + /** + * Make an empty header + */ + public JwtHeader() { + super(); + } + + /** + * Build a header from a JSON object + * @param json + */ + public JwtHeader(JsonObject json) { + super(json); + } + + + public JwtHeader(String b64) { + super(b64); + } + + /** + * Load all claims from the given json object into this object + */ + @Override + public void loadFromJsonObject(JsonObject json) { + + JsonObject pass = new JsonObject(); + + for (Entry element : json.entrySet()) { + if (element.getValue().isJsonNull()) { + pass.add(element.getKey(), element.getValue()); + } else if (element.getKey().equals(TYPE)) { + this.setType(json.get(TYPE).getAsString()); + } else if (element.getKey().equals(ALGORITHM)) { + this.setAlgorithm(json.get(ALGORITHM).getAsString()); + } else if (element.getKey().equals(ENCRYPTION_METHOD)) { + this.setEncryptionMethod(json.get(ENCRYPTION_METHOD).getAsString()); + } else { + pass.add(element.getKey(), element.getValue()); + } + } + + // now load all the ones we didn't handle specially + super.loadFromJsonObject(pass); + } + + /** + * @return the type + */ + public String getType() { + return getClaimAsString(TYPE); + } + + + /** + * @param type the type to set + */ + public void setType(String type) { + setClaim(TYPE, type); + } + + + /** + * @return the algorithm + */ + public String getAlgorithm() { + return getClaimAsString(ALGORITHM); + } + + + /** + * @param algorithm the algorithm to set + */ + public void setAlgorithm(String algorithm) { + setClaim(ALGORITHM, algorithm); + } + + + /** + * @return the encryptionMethod + */ + public String getEncryptionMethod() { + return getClaimAsString(ENCRYPTION_METHOD); + } + + + /** + * @param encryptionMethod the encryptionMethod to set + */ + public void setEncryptionMethod(String encryptionMethod) { + setClaim(ENCRYPTION_METHOD, encryptionMethod); + } + +} diff --git a/openid-connect-server/src/main/java/org/mitre/jwt/signer/AbstractJwtSigner.java b/openid-connect-common/src/main/java/org/mitre/jwt/signer/AbstractJwtSigner.java similarity index 72% rename from openid-connect-server/src/main/java/org/mitre/jwt/signer/AbstractJwtSigner.java rename to openid-connect-common/src/main/java/org/mitre/jwt/signer/AbstractJwtSigner.java index 6c8fa969f..7aeeb4cb3 100644 --- a/openid-connect-server/src/main/java/org/mitre/jwt/signer/AbstractJwtSigner.java +++ b/openid-connect-common/src/main/java/org/mitre/jwt/signer/AbstractJwtSigner.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.signer; import java.util.List; @@ -78,4 +93,4 @@ public abstract class AbstractJwtSigner implements JwtSigner { protected abstract String generateSignature(String signatureBase); -} \ No newline at end of file +} diff --git a/openid-connect-server/src/main/java/org/mitre/jwt/signer/JwsAlgorithm.java b/openid-connect-common/src/main/java/org/mitre/jwt/signer/JwsAlgorithm.java similarity index 61% rename from openid-connect-server/src/main/java/org/mitre/jwt/signer/JwsAlgorithm.java rename to openid-connect-common/src/main/java/org/mitre/jwt/signer/JwsAlgorithm.java index fb0ef6a0f..32bd77573 100644 --- a/openid-connect-server/src/main/java/org/mitre/jwt/signer/JwsAlgorithm.java +++ b/openid-connect-common/src/main/java/org/mitre/jwt/signer/JwsAlgorithm.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.signer; import org.apache.commons.lang.StringUtils; diff --git a/openid-connect-common/src/main/java/org/mitre/jwt/signer/JwtSigner.java b/openid-connect-common/src/main/java/org/mitre/jwt/signer/JwtSigner.java new file mode 100644 index 000000000..a43314659 --- /dev/null +++ b/openid-connect-common/src/main/java/org/mitre/jwt/signer/JwtSigner.java @@ -0,0 +1,26 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.signer; + +import org.mitre.jwt.model.Jwt; + +public interface JwtSigner { + + public Jwt sign(Jwt jwt); + + public boolean verify(String jwtString); + +} diff --git a/openid-connect-server/src/main/java/org/mitre/jwt/signer/impl/HmacSigner.java b/openid-connect-common/src/main/java/org/mitre/jwt/signer/impl/HmacSigner.java similarity index 84% rename from openid-connect-server/src/main/java/org/mitre/jwt/signer/impl/HmacSigner.java rename to openid-connect-common/src/main/java/org/mitre/jwt/signer/impl/HmacSigner.java index 942fcacf9..974ed43f1 100644 --- a/openid-connect-server/src/main/java/org/mitre/jwt/signer/impl/HmacSigner.java +++ b/openid-connect-common/src/main/java/org/mitre/jwt/signer/impl/HmacSigner.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.signer.impl; import java.io.UnsupportedEncodingException; @@ -166,4 +181,4 @@ public class HmacSigner extends AbstractJwtSigner implements InitializingBean { public String toString() { return "HmacSigner [mac=" + mac + ", passphrase=" + passphrase + "]"; } -} \ No newline at end of file +} diff --git a/openid-connect-common/src/main/java/org/mitre/jwt/signer/impl/PlaintextSigner.java b/openid-connect-common/src/main/java/org/mitre/jwt/signer/impl/PlaintextSigner.java new file mode 100644 index 000000000..36f4da22e --- /dev/null +++ b/openid-connect-common/src/main/java/org/mitre/jwt/signer/impl/PlaintextSigner.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.signer.impl; + +import org.mitre.jwt.signer.AbstractJwtSigner; + +public class PlaintextSigner extends AbstractJwtSigner { + + // Todo: should this be a JwsAlgorithm? + public static final String PLAINTEXT = "none"; + + public PlaintextSigner() { + super(PLAINTEXT); + } + + @Override + protected String generateSignature(String signatureBase) { + return null; + } + +} diff --git a/openid-connect-server/src/main/java/org/mitre/jwt/signer/impl/RsaSigner.java b/openid-connect-common/src/main/java/org/mitre/jwt/signer/impl/RsaSigner.java similarity index 90% rename from openid-connect-server/src/main/java/org/mitre/jwt/signer/impl/RsaSigner.java rename to openid-connect-common/src/main/java/org/mitre/jwt/signer/impl/RsaSigner.java index 66739680b..d12869259 100644 --- a/openid-connect-server/src/main/java/org/mitre/jwt/signer/impl/RsaSigner.java +++ b/openid-connect-common/src/main/java/org/mitre/jwt/signer/impl/RsaSigner.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.signer.impl; import java.io.UnsupportedEncodingException; @@ -262,4 +277,4 @@ public class RsaSigner extends AbstractJwtSigner implements InitializingBean { return value; } -} \ No newline at end of file +} diff --git a/openid-connect-server/src/main/java/org/mitre/jwt/signer/service/JwtSigningAndValidationService.java b/openid-connect-common/src/main/java/org/mitre/jwt/signer/service/JwtSigningAndValidationService.java similarity index 74% rename from openid-connect-server/src/main/java/org/mitre/jwt/signer/service/JwtSigningAndValidationService.java rename to openid-connect-common/src/main/java/org/mitre/jwt/signer/service/JwtSigningAndValidationService.java index e553a0fe2..44c956302 100644 --- a/openid-connect-server/src/main/java/org/mitre/jwt/signer/service/JwtSigningAndValidationService.java +++ b/openid-connect-common/src/main/java/org/mitre/jwt/signer/service/JwtSigningAndValidationService.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.signer.service; import java.security.PublicKey; diff --git a/openid-connect-server/src/main/java/org/mitre/jwt/signer/service/impl/JwtSigningAndValidationServiceDefault.java b/openid-connect-common/src/main/java/org/mitre/jwt/signer/service/impl/JwtSigningAndValidationServiceDefault.java similarity index 85% rename from openid-connect-server/src/main/java/org/mitre/jwt/signer/service/impl/JwtSigningAndValidationServiceDefault.java rename to openid-connect-common/src/main/java/org/mitre/jwt/signer/service/impl/JwtSigningAndValidationServiceDefault.java index 4814b463e..2237e19ac 100644 --- a/openid-connect-server/src/main/java/org/mitre/jwt/signer/service/impl/JwtSigningAndValidationServiceDefault.java +++ b/openid-connect-common/src/main/java/org/mitre/jwt/signer/service/impl/JwtSigningAndValidationServiceDefault.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.signer.service.impl; import java.security.PublicKey; diff --git a/openid-connect-server/src/main/java/org/mitre/jwt/signer/service/impl/KeyStore.java b/openid-connect-common/src/main/java/org/mitre/jwt/signer/service/impl/KeyStore.java similarity index 81% rename from openid-connect-server/src/main/java/org/mitre/jwt/signer/service/impl/KeyStore.java rename to openid-connect-common/src/main/java/org/mitre/jwt/signer/service/impl/KeyStore.java index cfecca302..b3afc9122 100644 --- a/openid-connect-server/src/main/java/org/mitre/jwt/signer/service/impl/KeyStore.java +++ b/openid-connect-common/src/main/java/org/mitre/jwt/signer/service/impl/KeyStore.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.signer.service.impl; import java.io.InputStream; diff --git a/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntity.java b/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntity.java index a4eb4170e..536bdf116 100644 --- a/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntity.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntity.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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. + ******************************************************************************/ /** * */ diff --git a/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntityFactory.java b/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntityFactory.java index f3412f1a6..7b21d9c58 100644 --- a/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntityFactory.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntityFactory.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.model; diff --git a/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientGeneratorFactory.java b/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientGeneratorFactory.java index ceaa22cf6..833692444 100644 --- a/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientGeneratorFactory.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientGeneratorFactory.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.model; import java.util.UUID; diff --git a/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2AccessTokenEntity.java b/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2AccessTokenEntity.java index 787cae18f..be11e0f71 100644 --- a/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2AccessTokenEntity.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2AccessTokenEntity.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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. + ******************************************************************************/ /** * */ diff --git a/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2AccessTokenEntityFactory.java b/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2AccessTokenEntityFactory.java index b4bd1ba38..bab5e1314 100644 --- a/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2AccessTokenEntityFactory.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2AccessTokenEntityFactory.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.model; public interface OAuth2AccessTokenEntityFactory { diff --git a/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2RefreshTokenEntity.java b/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2RefreshTokenEntity.java index ef11eebf0..b61baba52 100644 --- a/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2RefreshTokenEntity.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2RefreshTokenEntity.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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. + ******************************************************************************/ /** * */ diff --git a/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2RefreshTokenEntityFactory.java b/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2RefreshTokenEntityFactory.java index 2a6ac4785..c0ef52157 100644 --- a/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2RefreshTokenEntityFactory.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/model/OAuth2RefreshTokenEntityFactory.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.model; public interface OAuth2RefreshTokenEntityFactory { diff --git a/openid-connect-common/src/main/java/org/mitre/oauth2/model/UUIDTokenFactory.java b/openid-connect-common/src/main/java/org/mitre/oauth2/model/UUIDTokenFactory.java index 91f93856a..2709adc83 100644 --- a/openid-connect-common/src/main/java/org/mitre/oauth2/model/UUIDTokenFactory.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/model/UUIDTokenFactory.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.model; import java.util.UUID; diff --git a/openid-connect-common/src/main/java/org/mitre/oauth2/repository/OAuth2ClientRepository.java b/openid-connect-common/src/main/java/org/mitre/oauth2/repository/OAuth2ClientRepository.java new file mode 100644 index 000000000..a1add46d6 --- /dev/null +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/repository/OAuth2ClientRepository.java @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.repository; + +import java.util.Collection; + +import org.mitre.oauth2.model.ClientDetailsEntity; + +public interface OAuth2ClientRepository { + + public ClientDetailsEntity getClientById(String clientId); + + public ClientDetailsEntity saveClient(ClientDetailsEntity client); + + public void deleteClient(ClientDetailsEntity client); + + public ClientDetailsEntity updateClient(String clientId, ClientDetailsEntity client); + + public Collection getAllClients(); + +} diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/repository/OAuth2TokenRepository.java b/openid-connect-common/src/main/java/org/mitre/oauth2/repository/OAuth2TokenRepository.java similarity index 64% rename from openid-connect-server/src/main/java/org/mitre/oauth2/repository/OAuth2TokenRepository.java rename to openid-connect-common/src/main/java/org/mitre/oauth2/repository/OAuth2TokenRepository.java index 7d39e01fb..4dbee486f 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/repository/OAuth2TokenRepository.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/repository/OAuth2TokenRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.repository; import java.util.List; diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/service/ClientDetailsEntityService.java b/openid-connect-common/src/main/java/org/mitre/oauth2/service/ClientDetailsEntityService.java similarity index 58% rename from openid-connect-server/src/main/java/org/mitre/oauth2/service/ClientDetailsEntityService.java rename to openid-connect-common/src/main/java/org/mitre/oauth2/service/ClientDetailsEntityService.java index d1c9757ad..dad0c75e0 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/service/ClientDetailsEntityService.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/service/ClientDetailsEntityService.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.service; import java.util.Collection; diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/service/OAuth2TokenEntityService.java b/openid-connect-common/src/main/java/org/mitre/oauth2/service/OAuth2TokenEntityService.java similarity index 61% rename from openid-connect-server/src/main/java/org/mitre/oauth2/service/OAuth2TokenEntityService.java rename to openid-connect-common/src/main/java/org/mitre/oauth2/service/OAuth2TokenEntityService.java index 498a8f136..3a37f02a1 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/service/OAuth2TokenEntityService.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/service/OAuth2TokenEntityService.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.service; import java.util.List; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/config/ConfigurationPropertiesBean.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/config/ConfigurationPropertiesBean.java similarity index 52% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/config/ConfigurationPropertiesBean.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/config/ConfigurationPropertiesBean.java index 2fb276e4a..f83432573 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/config/ConfigurationPropertiesBean.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/config/ConfigurationPropertiesBean.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.config; diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/Address.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/Address.java index 4721abbf3..0d57b0193 100644 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/Address.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/Address.java @@ -1,123 +1,138 @@ -package org.mitre.openid.connect.model; - -import javax.persistence.Basic; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; - -@Entity -public class Address { - - - private Long id; - private String formatted; - private String streetAddress; - private String locality; - private String region; - private String postalCode; - private String country; - - /** - * Empty constructor - */ - public Address() { - - } - - /** - * @return the formatted address string - */ - @Basic - public String getFormatted() { - return formatted; - } - /** - * @param formatted the formatted address to set - */ - public void setFormatted(String formatted) { - this.formatted = formatted; - } - /** - * @return the streetAddress - */ - @Basic - public String getStreetAddress() { - return streetAddress; - } - /** - * @param streetAddress the streetAddress to set - */ - public void setStreetAddress(String streetAddress) { - this.streetAddress = streetAddress; - } - /** - * @return the locality - */ - @Basic - public String getLocality() { - return locality; - } - /** - * @param locality the locality to set - */ - public void setLocality(String locality) { - this.locality = locality; - } - /** - * @return the region - */ - @Basic - public String getRegion() { - return region; - } - /** - * @param region the region to set - */ - public void setRegion(String region) { - this.region = region; - } - /** - * @return the postalCode - */ - @Basic - public String getPostalCode() { - return postalCode; - } - /** - * @param postalCode the postalCode to set - */ - public void setPostalCode(String postalCode) { - this.postalCode = postalCode; - } - /** - * @return the country - */ - @Basic - public String getCountry() { - return country; - } - /** - * @param country the country to set - */ - public void setCountry(String country) { - this.country = country; - } - - /** - * @return the id - */ - @Id - @GeneratedValue(strategy=GenerationType.IDENTITY) - public Long getId() { - return id; - } - - /** - * @param id the id to set - */ - public void setId(Long id) { - this.id = id; - } - -} +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.model; + +import javax.persistence.Basic; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; + +@Entity +public class Address { + + + private Long id; + private String formatted; + private String streetAddress; + private String locality; + private String region; + private String postalCode; + private String country; + + /** + * Empty constructor + */ + public Address() { + + } + + /** + * @return the formatted address string + */ + @Basic + public String getFormatted() { + return formatted; + } + /** + * @param formatted the formatted address to set + */ + public void setFormatted(String formatted) { + this.formatted = formatted; + } + /** + * @return the streetAddress + */ + @Basic + public String getStreetAddress() { + return streetAddress; + } + /** + * @param streetAddress the streetAddress to set + */ + public void setStreetAddress(String streetAddress) { + this.streetAddress = streetAddress; + } + /** + * @return the locality + */ + @Basic + public String getLocality() { + return locality; + } + /** + * @param locality the locality to set + */ + public void setLocality(String locality) { + this.locality = locality; + } + /** + * @return the region + */ + @Basic + public String getRegion() { + return region; + } + /** + * @param region the region to set + */ + public void setRegion(String region) { + this.region = region; + } + /** + * @return the postalCode + */ + @Basic + public String getPostalCode() { + return postalCode; + } + /** + * @param postalCode the postalCode to set + */ + public void setPostalCode(String postalCode) { + this.postalCode = postalCode; + } + /** + * @return the country + */ + @Basic + public String getCountry() { + return country; + } + /** + * @param country the country to set + */ + public void setCountry(String country) { + this.country = country; + } + + /** + * @return the id + */ + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + public Long getId() { + return id; + } + + /** + * @param id the id to set + */ + public void setId(Long id) { + this.id = id; + } + +} diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/ApprovedSite.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/ApprovedSite.java index 2e08c0d6b..6f6f03fc0 100644 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/ApprovedSite.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/ApprovedSite.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.model; import java.util.Date; diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/Event.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/Event.java index c1450afd8..1ef2551b6 100644 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/Event.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/Event.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.model; import java.util.Date; diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/IdToken.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/IdToken.java index c5fd3a054..0c1932a20 100644 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/IdToken.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/IdToken.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.model; import java.util.List; diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/IdTokenClaims.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/IdTokenClaims.java index 30c6d9799..4e151faf3 100644 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/IdTokenClaims.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/IdTokenClaims.java @@ -1,154 +1,169 @@ -package org.mitre.openid.connect.model; - -import java.util.Date; -import java.util.Map.Entry; - -import javax.persistence.Basic; -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.Table; -import javax.persistence.Transient; - -import org.mitre.jwt.model.JwtClaims; - -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; - - -@Entity -@Table(name="idtokenclaims") -public class IdTokenClaims extends JwtClaims { - - public static final String USER_ID = "user_id"; - public static final String AUTHENTICATION_CONTEXT_CLASS_REFERENCE = "acr"; - public static final String NONCE = "nonce"; - public static final String AUTH_TIME = "auth_time"; - - private Long id; - - - - public IdTokenClaims() { - super(); - } - - public IdTokenClaims(JsonObject json) { - super(json); - } - - public IdTokenClaims(String b64) { - super(b64); - } - - /** - * @return the id - */ - @Id - @GeneratedValue(strategy=GenerationType.IDENTITY) - public Long getId() { - return id; - } - /** - * @param id the id to set - */ - public void setId(Long id) { - this.id = id; - } - - @Transient - public String getUserId() { - return getClaimAsString(USER_ID); - } - - public void setUserId(String user_id) { - setClaim(USER_ID, user_id); - } - - @Transient - public String getAuthContext() { - return getClaimAsString(AUTHENTICATION_CONTEXT_CLASS_REFERENCE); - } - - public void setAuthContext(String acr) { - setClaim(AUTHENTICATION_CONTEXT_CLASS_REFERENCE, acr); - } - - @Transient - public String getNonce() { - return getClaimAsString(NONCE); - } - - public void setNonce(String nonce) { - setClaim(NONCE, nonce); - } - - @Transient - public Date getAuthTime() { - return getClaimAsDate(AUTH_TIME); - } - - public void setAuthTime(Date authTime) { - setClaim(AUTH_TIME, authTime); - } - - - /** - * Get the seraialized form of this claim set - */ - @Basic - public String getSerializedForm() { - // TODO Auto-generated method stub - JsonObject o = super.getAsJsonObject(); - - return o.toString(); - } - - /** - * Set up the claims in this object from the serialized form. This clears all current claims from the object. - * @param s a JSON Object string to load into this object - * @throws IllegalArgumentException if s is not a valid JSON object string - */ - public void setSerializedForm(String s) { - JsonParser parser = new JsonParser(); - JsonElement json = parser.parse(s); - if (json != null && json.isJsonObject()) { - loadFromJsonObject(json.getAsJsonObject()); - } else { - throw new IllegalArgumentException("Could not parse: " + s); - } - } - - // - // FIXME: - // This doesn't handle loading JsonNull values from the claims set, and this is endemic to the whole claims structure!!!! - // - - /** - * Load this IdToken from a JSON Object - */ - @Override - public void loadFromJsonObject(JsonObject json) { - JsonObject pass = new JsonObject(); - - for (Entry element : json.entrySet()) { - if (element.getValue().isJsonNull()) { - pass.add(element.getKey(), element.getValue()); - } else if (element.getKey().equals(USER_ID)) { - setUserId(element.getValue().getAsString()); - } else if (element.getKey().equals(AUTHENTICATION_CONTEXT_CLASS_REFERENCE)) { - setAuthContext(element.getValue().getAsString()); - } else if (element.getKey().equals(NONCE)) { - setNonce(element.getValue().getAsString()); - } else if (element.getKey().equals(AUTH_TIME)) { - setAuthTime(new Date(element.getValue().getAsLong() * 1000L)); - } else { - pass.add(element.getKey(), element.getValue()); - } - } - - super.loadFromJsonObject(pass); - } -} +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.model; + +import java.util.Date; +import java.util.Map.Entry; + +import javax.persistence.Basic; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import javax.persistence.Transient; + +import org.mitre.jwt.model.JwtClaims; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; + + +@Entity +@Table(name="idtokenclaims") +public class IdTokenClaims extends JwtClaims { + + public static final String USER_ID = "user_id"; + public static final String AUTHENTICATION_CONTEXT_CLASS_REFERENCE = "acr"; + public static final String NONCE = "nonce"; + public static final String AUTH_TIME = "auth_time"; + + private Long id; + + + + public IdTokenClaims() { + super(); + } + + public IdTokenClaims(JsonObject json) { + super(json); + } + + public IdTokenClaims(String b64) { + super(b64); + } + + /** + * @return the id + */ + @Id + @GeneratedValue(strategy=GenerationType.IDENTITY) + public Long getId() { + return id; + } + /** + * @param id the id to set + */ + public void setId(Long id) { + this.id = id; + } + + @Transient + public String getUserId() { + return getClaimAsString(USER_ID); + } + + public void setUserId(String user_id) { + setClaim(USER_ID, user_id); + } + + @Transient + public String getAuthContext() { + return getClaimAsString(AUTHENTICATION_CONTEXT_CLASS_REFERENCE); + } + + public void setAuthContext(String acr) { + setClaim(AUTHENTICATION_CONTEXT_CLASS_REFERENCE, acr); + } + + @Transient + public String getNonce() { + return getClaimAsString(NONCE); + } + + public void setNonce(String nonce) { + setClaim(NONCE, nonce); + } + + @Transient + public Date getAuthTime() { + return getClaimAsDate(AUTH_TIME); + } + + public void setAuthTime(Date authTime) { + setClaim(AUTH_TIME, authTime); + } + + + /** + * Get the seraialized form of this claim set + */ + @Basic + public String getSerializedForm() { + // TODO Auto-generated method stub + JsonObject o = super.getAsJsonObject(); + + return o.toString(); + } + + /** + * Set up the claims in this object from the serialized form. This clears all current claims from the object. + * @param s a JSON Object string to load into this object + * @throws IllegalArgumentException if s is not a valid JSON object string + */ + public void setSerializedForm(String s) { + JsonParser parser = new JsonParser(); + JsonElement json = parser.parse(s); + if (json != null && json.isJsonObject()) { + loadFromJsonObject(json.getAsJsonObject()); + } else { + throw new IllegalArgumentException("Could not parse: " + s); + } + } + + // + // FIXME: + // This doesn't handle loading JsonNull values from the claims set, and this is endemic to the whole claims structure!!!! + // + + /** + * Load this IdToken from a JSON Object + */ + @Override + public void loadFromJsonObject(JsonObject json) { + JsonObject pass = new JsonObject(); + + for (Entry element : json.entrySet()) { + if (element.getValue().isJsonNull()) { + pass.add(element.getKey(), element.getValue()); + } else if (element.getKey().equals(USER_ID)) { + setUserId(element.getValue().getAsString()); + } else if (element.getKey().equals(AUTHENTICATION_CONTEXT_CLASS_REFERENCE)) { + setAuthContext(element.getValue().getAsString()); + } else if (element.getKey().equals(NONCE)) { + setNonce(element.getValue().getAsString()); + } else if (element.getKey().equals(AUTH_TIME)) { + setAuthTime(new Date(element.getValue().getAsLong() * 1000L)); + } else { + pass.add(element.getKey(), element.getValue()); + } + } + + super.loadFromJsonObject(pass); + } +} diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/UserInfo.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/UserInfo.java index ff1803bd8..637576c5c 100644 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/UserInfo.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/UserInfo.java @@ -1,295 +1,310 @@ -package org.mitre.openid.connect.model; - -import javax.persistence.Basic; -import javax.persistence.Entity; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.NamedQueries; -import javax.persistence.NamedQuery; -import javax.persistence.OneToOne; -import javax.persistence.Table; - -import com.google.gson.JsonObject; - -@Entity -@Table(name="userinfo") -@NamedQueries({ - @NamedQuery(name="UserInfo.getAll", query = "select u from UserInfo u") -}) -public class UserInfo { - - private String userId; - private String name; - private String givenName; - private String familyName; - private String middleName; - private String nickname; - private String profile; - private String picture; - private String website; - private String email; - private Boolean verified; - private String gender; - private String zoneinfo; - private String locale; - private String phoneNumber; - private Address address; - private String updatedTime; - - - public JsonObject toJson() { - JsonObject obj = new JsonObject(); - - obj.addProperty("user_id", getUserId()); - obj.addProperty("name", getName()); - obj.addProperty("given_name", getGivenName()); - obj.addProperty("family_name", getFamilyName()); - obj.addProperty("middle_name", getMiddleName()); - obj.addProperty("nickname", getNickname()); - obj.addProperty("profile", getProfile()); - obj.addProperty("picture", getPicture()); - obj.addProperty("website", getWebsite()); - obj.addProperty("verified", getVerified()); - obj.addProperty("gender", getGender()); - obj.addProperty("zone_info", getZoneinfo()); - obj.addProperty("locale", getLocale()); - obj.addProperty("phone_number", getPhoneNumber()); - obj.addProperty("updated_time", getUpdatedTime()); - - JsonObject addr = new JsonObject(); - addr.addProperty("formatted", getAddress().getFormatted()); - addr.addProperty("street_address", getAddress().getStreetAddress()); - addr.addProperty("locality", getAddress().getLocality()); - addr.addProperty("region", getAddress().getRegion()); - addr.addProperty("postal_code", getAddress().getPostalCode()); - addr.addProperty("country", getAddress().getCountry()); - - obj.add("address", addr); - - return obj; - } - - /** - * @return the userId - */ - @Id - public String getUserId() { - return userId; - } - /** - * @param userId the userId to set - */ - public void setUserId(String userId) { - this.userId = userId; - } - /** - * @return the name - */ - @Basic - public String getName() { - return name; - } - /** - * @param name the name to set - */ - public void setName(String name) { - this.name = name; - } - /** - * @return the givenName - */ - @Basic - public String getGivenName() { - return givenName; - } - /** - * @param givenName the givenName to set - */ - public void setGivenName(String givenName) { - this.givenName = givenName; - } - /** - * @return the familyName - */ - @Basic - public String getFamilyName() { - return familyName; - } - /** - * @param familyName the familyName to set - */ - public void setFamilyName(String familyName) { - this.familyName = familyName; - } - /** - * @return the middleName - */ - @Basic - public String getMiddleName() { - return middleName; - } - /** - * @param middleName the middleName to set - */ - public void setMiddleName(String middleName) { - this.middleName = middleName; - } - /** - * @return the nickname - */ - @Basic - public String getNickname() { - return nickname; - } - /** - * @param nickname the nickname to set - */ - public void setNickname(String nickname) { - this.nickname = nickname; - } - /** - * @return the profile - */ - @Basic - public String getProfile() { - return profile; - } - /** - * @param profile the profile to set - */ - public void setProfile(String profile) { - this.profile = profile; - } - /** - * @return the picture - */ - @Basic - public String getPicture() { - return picture; - } - /** - * @param picture the picture to set - */ - public void setPicture(String picture) { - this.picture = picture; - } - /** - * @return the website - */ - @Basic - public String getWebsite() { - return website; - } - /** - * @param website the website to set - */ - public void setWebsite(String website) { - this.website = website; - } - /** - * @return the email - */ - @Basic - public String getEmail() { - return email; - } - /** - * @param email the email to set - */ - public void setEmail(String email) { - this.email = email; - } - /** - * @return the verified - */ - @Basic - public Boolean getVerified() { - return verified; - } - /** - * @param verified the verified to set - */ - public void setVerified(Boolean verified) { - this.verified = verified; - } - /** - * @return the gender - */ - @Basic - public String getGender() { - return gender; - } - /** - * @param gender the gender to set - */ - public void setGender(String gender) { - this.gender = gender; - } - /** - * @return the zoneinfo - */ - @Basic - public String getZoneinfo() { - return zoneinfo; - } - /** - * @param zoneinfo the zoneinfo to set - */ - public void setZoneinfo(String zoneinfo) { - this.zoneinfo = zoneinfo; - } - /** - * @return the locale - */ - @Basic - public String getLocale() { - return locale; - } - /** - * @param locale the locale to set - */ - public void setLocale(String locale) { - this.locale = locale; - } - /** - * @return the phoneNumber - */ - @Basic - public String getPhoneNumber() { - return phoneNumber; - } - /** - * @param phoneNumber the phoneNumber to set - */ - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - /** - * @return the address - */ - @OneToOne - @JoinColumn(name="address_id") - public Address getAddress() { - return address; - } - /** - * @param address the address to set - */ - public void setAddress(Address address) { - this.address = address; - } - /** - * @return the updatedTime - */ - @Basic - public String getUpdatedTime() { - return updatedTime; - } - /** - * @param updatedTime the updatedTime to set - */ - public void setUpdatedTime(String updatedTime) { - this.updatedTime = updatedTime; - } - -} +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.model; + +import javax.persistence.Basic; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.NamedQueries; +import javax.persistence.NamedQuery; +import javax.persistence.OneToOne; +import javax.persistence.Table; + +import com.google.gson.JsonObject; + +@Entity +@Table(name="userinfo") +@NamedQueries({ + @NamedQuery(name="UserInfo.getAll", query = "select u from UserInfo u") +}) +public class UserInfo { + + private String userId; + private String name; + private String givenName; + private String familyName; + private String middleName; + private String nickname; + private String profile; + private String picture; + private String website; + private String email; + private Boolean verified; + private String gender; + private String zoneinfo; + private String locale; + private String phoneNumber; + private Address address; + private String updatedTime; + + + public JsonObject toJson() { + JsonObject obj = new JsonObject(); + + obj.addProperty("user_id", getUserId()); + obj.addProperty("name", getName()); + obj.addProperty("given_name", getGivenName()); + obj.addProperty("family_name", getFamilyName()); + obj.addProperty("middle_name", getMiddleName()); + obj.addProperty("nickname", getNickname()); + obj.addProperty("profile", getProfile()); + obj.addProperty("picture", getPicture()); + obj.addProperty("website", getWebsite()); + obj.addProperty("verified", getVerified()); + obj.addProperty("gender", getGender()); + obj.addProperty("zone_info", getZoneinfo()); + obj.addProperty("locale", getLocale()); + obj.addProperty("phone_number", getPhoneNumber()); + obj.addProperty("updated_time", getUpdatedTime()); + + JsonObject addr = new JsonObject(); + addr.addProperty("formatted", getAddress().getFormatted()); + addr.addProperty("street_address", getAddress().getStreetAddress()); + addr.addProperty("locality", getAddress().getLocality()); + addr.addProperty("region", getAddress().getRegion()); + addr.addProperty("postal_code", getAddress().getPostalCode()); + addr.addProperty("country", getAddress().getCountry()); + + obj.add("address", addr); + + return obj; + } + + /** + * @return the userId + */ + @Id + public String getUserId() { + return userId; + } + /** + * @param userId the userId to set + */ + public void setUserId(String userId) { + this.userId = userId; + } + /** + * @return the name + */ + @Basic + public String getName() { + return name; + } + /** + * @param name the name to set + */ + public void setName(String name) { + this.name = name; + } + /** + * @return the givenName + */ + @Basic + public String getGivenName() { + return givenName; + } + /** + * @param givenName the givenName to set + */ + public void setGivenName(String givenName) { + this.givenName = givenName; + } + /** + * @return the familyName + */ + @Basic + public String getFamilyName() { + return familyName; + } + /** + * @param familyName the familyName to set + */ + public void setFamilyName(String familyName) { + this.familyName = familyName; + } + /** + * @return the middleName + */ + @Basic + public String getMiddleName() { + return middleName; + } + /** + * @param middleName the middleName to set + */ + public void setMiddleName(String middleName) { + this.middleName = middleName; + } + /** + * @return the nickname + */ + @Basic + public String getNickname() { + return nickname; + } + /** + * @param nickname the nickname to set + */ + public void setNickname(String nickname) { + this.nickname = nickname; + } + /** + * @return the profile + */ + @Basic + public String getProfile() { + return profile; + } + /** + * @param profile the profile to set + */ + public void setProfile(String profile) { + this.profile = profile; + } + /** + * @return the picture + */ + @Basic + public String getPicture() { + return picture; + } + /** + * @param picture the picture to set + */ + public void setPicture(String picture) { + this.picture = picture; + } + /** + * @return the website + */ + @Basic + public String getWebsite() { + return website; + } + /** + * @param website the website to set + */ + public void setWebsite(String website) { + this.website = website; + } + /** + * @return the email + */ + @Basic + public String getEmail() { + return email; + } + /** + * @param email the email to set + */ + public void setEmail(String email) { + this.email = email; + } + /** + * @return the verified + */ + @Basic + public Boolean getVerified() { + return verified; + } + /** + * @param verified the verified to set + */ + public void setVerified(Boolean verified) { + this.verified = verified; + } + /** + * @return the gender + */ + @Basic + public String getGender() { + return gender; + } + /** + * @param gender the gender to set + */ + public void setGender(String gender) { + this.gender = gender; + } + /** + * @return the zoneinfo + */ + @Basic + public String getZoneinfo() { + return zoneinfo; + } + /** + * @param zoneinfo the zoneinfo to set + */ + public void setZoneinfo(String zoneinfo) { + this.zoneinfo = zoneinfo; + } + /** + * @return the locale + */ + @Basic + public String getLocale() { + return locale; + } + /** + * @param locale the locale to set + */ + public void setLocale(String locale) { + this.locale = locale; + } + /** + * @return the phoneNumber + */ + @Basic + public String getPhoneNumber() { + return phoneNumber; + } + /** + * @param phoneNumber the phoneNumber to set + */ + public void setPhoneNumber(String phoneNumber) { + this.phoneNumber = phoneNumber; + } + /** + * @return the address + */ + @OneToOne + @JoinColumn(name="address_id") + public Address getAddress() { + return address; + } + /** + * @param address the address to set + */ + public void setAddress(Address address) { + this.address = address; + } + /** + * @return the updatedTime + */ + @Basic + public String getUpdatedTime() { + return updatedTime; + } + /** + * @param updatedTime the updatedTime to set + */ + public void setUpdatedTime(String updatedTime) { + this.updatedTime = updatedTime; + } + +} diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/WhitelistedSite.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/WhitelistedSite.java index 51c78fb45..9c4ec29f5 100644 --- a/openid-connect-common/src/main/java/org/mitre/openid/connect/model/WhitelistedSite.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/model/WhitelistedSite.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.model; import java.util.Set; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/AddressRepository.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/AddressRepository.java similarity index 53% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/repository/AddressRepository.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/repository/AddressRepository.java index 108f50fe2..4f2cfa814 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/AddressRepository.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/AddressRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository; import org.mitre.openid.connect.model.Address; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/ApprovedSiteRepository.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/ApprovedSiteRepository.java similarity index 69% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/repository/ApprovedSiteRepository.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/repository/ApprovedSiteRepository.java index 4c6646eac..7bd08bea8 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/ApprovedSiteRepository.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/ApprovedSiteRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository; import java.util.Collection; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/EventRepository.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/EventRepository.java similarity index 64% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/repository/EventRepository.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/repository/EventRepository.java index 819a048ed..542a400b3 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/EventRepository.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/EventRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository; import java.util.Collection; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/IdTokenClaimsRepository.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/IdTokenClaimsRepository.java similarity index 54% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/repository/IdTokenClaimsRepository.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/repository/IdTokenClaimsRepository.java index 9bcb6ded8..ebfe7e6cf 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/IdTokenClaimsRepository.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/IdTokenClaimsRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository; import org.mitre.openid.connect.model.IdTokenClaims; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/IdTokenRepository.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/IdTokenRepository.java similarity index 52% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/repository/IdTokenRepository.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/repository/IdTokenRepository.java index ba20c8156..9f86d3c4f 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/IdTokenRepository.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/IdTokenRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository; import org.mitre.openid.connect.model.IdToken; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/UserInfoRepository.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/UserInfoRepository.java similarity index 60% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/repository/UserInfoRepository.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/repository/UserInfoRepository.java index ca441f131..74c673645 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/UserInfoRepository.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/UserInfoRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository; import java.util.Collection; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/WhitelistedSiteRepository.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/WhitelistedSiteRepository.java similarity index 61% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/repository/WhitelistedSiteRepository.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/repository/WhitelistedSiteRepository.java index 22bf14833..908cd7795 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/WhitelistedSiteRepository.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/repository/WhitelistedSiteRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository; import java.util.Collection; diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/service/AddressService.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/AddressService.java new file mode 100644 index 000000000..d4ac7f419 --- /dev/null +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/AddressService.java @@ -0,0 +1,60 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service; + +import org.mitre.openid.connect.model.Address; + +/** + * Interface for Address service + * + * @author Michael Joseph Walsh + * + */ +public interface AddressService { + + /** + * Save an Address + * + * @param address + * the Address to be saved + */ + public void save(Address address); + + /** + * Get Address for id + * + * @param id + * id for Address + * @return Address for id, or null + */ + public Address getById(Long id); + + /** + * Remove the Address + * + * @param address + * the Address to remove + */ + public void remove(Address address); + + /** + * Remove the Address + * + * @param id + * id for Address to remove + */ + public void removeById(Long id); +} diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/ApprovedSiteService.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/ApprovedSiteService.java similarity index 67% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/service/ApprovedSiteService.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/service/ApprovedSiteService.java index 8ddecbd0d..07370e122 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/ApprovedSiteService.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/ApprovedSiteService.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service; import java.util.Collection; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/ClientUserDetailsService.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/ClientUserDetailsService.java similarity index 73% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/service/ClientUserDetailsService.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/service/ClientUserDetailsService.java index a2b27ebc4..dcb4a9c1f 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/ClientUserDetailsService.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/ClientUserDetailsService.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service; import java.util.ArrayList; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/EventService.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/EventService.java similarity index 61% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/service/EventService.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/service/EventService.java index 3e77baeb7..0979c031a 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/EventService.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/EventService.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service; import java.util.Collection; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/IdTokenClaimsService.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenClaimsService.java similarity index 52% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/service/IdTokenClaimsService.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenClaimsService.java index e968ad00a..320a6019c 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/IdTokenClaimsService.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenClaimsService.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service; import org.mitre.openid.connect.model.IdTokenClaims; diff --git a/openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenService.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenService.java new file mode 100644 index 000000000..84281358b --- /dev/null +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/IdTokenService.java @@ -0,0 +1,60 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service; + +import org.mitre.openid.connect.model.IdToken; + +/** + * Interface for IdToken service + * + * @author Michael Joseph Walsh + * + */ +public interface IdTokenService { + + /** + * Save an IdToken + * + * @param idToken + * the IdToken to be saved + */ + public void save(IdToken idToken); + + /** + * Get IdToken for id + * + * @param id + * id for IdToken + * @return IdToken for id, or null + */ + public IdToken getById(Long id); + + /** + * Remove the IdToken + * + * @param idToken + * the IdToken to remove + */ + public void remove(IdToken idToken); + + /** + * Remove the IdToken + * + * @param id + * id for IdToken to remove + */ + public void removeById(Long id); +} diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/UserInfoService.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/UserInfoService.java similarity index 51% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/service/UserInfoService.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/service/UserInfoService.java index 205e343c4..365cfa9c0 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/UserInfoService.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/UserInfoService.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service; import org.mitre.openid.connect.model.UserInfo; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/WhitelistedSiteService.java b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/WhitelistedSiteService.java similarity index 57% rename from openid-connect-server/src/main/java/org/mitre/openid/connect/service/WhitelistedSiteService.java rename to openid-connect-common/src/main/java/org/mitre/openid/connect/service/WhitelistedSiteService.java index 5643db7b5..bb0d67a0d 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/WhitelistedSiteService.java +++ b/openid-connect-common/src/main/java/org/mitre/openid/connect/service/WhitelistedSiteService.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service; import org.mitre.openid.connect.model.WhitelistedSite; diff --git a/openid-connect-server/src/main/java/org/mitre/util/Utility.java b/openid-connect-common/src/main/java/org/mitre/util/Utility.java similarity index 51% rename from openid-connect-server/src/main/java/org/mitre/util/Utility.java rename to openid-connect-common/src/main/java/org/mitre/util/Utility.java index 8799c3cb9..d6655286a 100644 --- a/openid-connect-server/src/main/java/org/mitre/util/Utility.java +++ b/openid-connect-common/src/main/java/org/mitre/util/Utility.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.util; import javax.servlet.http.HttpServletRequest; diff --git a/openid-connect-server/src/main/java/org/mitre/util/jpa/JpaUtil.java b/openid-connect-common/src/main/java/org/mitre/util/jpa/JpaUtil.java similarity index 54% rename from openid-connect-server/src/main/java/org/mitre/util/jpa/JpaUtil.java rename to openid-connect-common/src/main/java/org/mitre/util/jpa/JpaUtil.java index 0f897d5e7..6ecc5212c 100644 --- a/openid-connect-server/src/main/java/org/mitre/util/jpa/JpaUtil.java +++ b/openid-connect-common/src/main/java/org/mitre/util/jpa/JpaUtil.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.util.jpa; import java.util.List; diff --git a/openid-connect-server/src/main/java/org/mitre/jwt/signer/JwtSigner.java b/openid-connect-server/src/main/java/org/mitre/jwt/signer/JwtSigner.java deleted file mode 100644 index 1ab37ef6b..000000000 --- a/openid-connect-server/src/main/java/org/mitre/jwt/signer/JwtSigner.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.mitre.jwt.signer; - -import org.mitre.jwt.model.Jwt; - -public interface JwtSigner { - - public Jwt sign(Jwt jwt); - - public boolean verify(String jwtString); - -} diff --git a/openid-connect-server/src/main/java/org/mitre/jwt/signer/impl/PlaintextSigner.java b/openid-connect-server/src/main/java/org/mitre/jwt/signer/impl/PlaintextSigner.java deleted file mode 100644 index 59b7d02d3..000000000 --- a/openid-connect-server/src/main/java/org/mitre/jwt/signer/impl/PlaintextSigner.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.mitre.jwt.signer.impl; - -import org.mitre.jwt.signer.AbstractJwtSigner; - -public class PlaintextSigner extends AbstractJwtSigner { - - // Todo: should this be a JwsAlgorithm? - public static final String PLAINTEXT = "none"; - - public PlaintextSigner() { - super(PLAINTEXT); - } - - @Override - protected String generateSignature(String signatureBase) { - return null; - } - -} diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/exception/ClientNotFoundException.java b/openid-connect-server/src/main/java/org/mitre/oauth2/exception/ClientNotFoundException.java index 94fe88eff..47dccf0ba 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/exception/ClientNotFoundException.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/exception/ClientNotFoundException.java @@ -1,50 +1,65 @@ -package org.mitre.oauth2.exception; -/** - * - */ - - -/** - * @author aanganes - * - */ -public class ClientNotFoundException extends RuntimeException { - - /** - * - */ - private static final Long serialVersionUID = 1L; - - /** - * - */ - public ClientNotFoundException() { - // TODO Auto-generated constructor stub - } - - /** - * @param message - */ - public ClientNotFoundException(String message) { - super(message); - // TODO Auto-generated constructor stub - } - - /** - * @param cause - */ - public ClientNotFoundException(Throwable cause) { - super(cause); - // TODO Auto-generated constructor stub - } - - /** - * @param message - * @param cause - */ - public ClientNotFoundException(String message, Throwable cause) { - super(message, cause); - // TODO Auto-generated constructor stub - } - -} +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.exception; +/** + * + */ + + +/** + * @author aanganes + * + */ +public class ClientNotFoundException extends RuntimeException { + + /** + * + */ + private static final Long serialVersionUID = 1L; + + /** + * + */ + public ClientNotFoundException() { + // TODO Auto-generated constructor stub + } + + /** + * @param message + */ + public ClientNotFoundException(String message) { + super(message); + // TODO Auto-generated constructor stub + } + + /** + * @param cause + */ + public ClientNotFoundException(Throwable cause) { + super(cause); + // TODO Auto-generated constructor stub + } + + /** + * @param message + * @param cause + */ + public ClientNotFoundException(String message, Throwable cause) { + super(message, cause); + // TODO Auto-generated constructor stub + } + +} diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/exception/DuplicateClientIdException.java b/openid-connect-server/src/main/java/org/mitre/oauth2/exception/DuplicateClientIdException.java index 78ff82b2c..0c0f424da 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/exception/DuplicateClientIdException.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/exception/DuplicateClientIdException.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.exception; public class DuplicateClientIdException extends RuntimeException { diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/exception/PermissionDeniedException.java b/openid-connect-server/src/main/java/org/mitre/oauth2/exception/PermissionDeniedException.java index c6f2bea6e..ae4f270c7 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/exception/PermissionDeniedException.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/exception/PermissionDeniedException.java @@ -1,49 +1,64 @@ -/** - * - */ -package org.mitre.oauth2.exception; - -/** - * @author AANGANES - * - */ -public class PermissionDeniedException extends RuntimeException { - - /** - * - */ - private static final Long serialVersionUID = 1L; - - /** - * - */ - public PermissionDeniedException() { - // TODO Auto-generated constructor stub - } - - /** - * @param message - */ - public PermissionDeniedException(String message) { - super(message); - // TODO Auto-generated constructor stub - } - - /** - * @param cause - */ - public PermissionDeniedException(Throwable cause) { - super(cause); - // TODO Auto-generated constructor stub - } - - /** - * @param message - * @param cause - */ - public PermissionDeniedException(String message, Throwable cause) { - super(message, cause); - // TODO Auto-generated constructor stub - } - -} +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.exception; + +/** + * @author AANGANES + * + */ +public class PermissionDeniedException extends RuntimeException { + + /** + * + */ + private static final Long serialVersionUID = 1L; + + /** + * + */ + public PermissionDeniedException() { + // TODO Auto-generated constructor stub + } + + /** + * @param message + */ + public PermissionDeniedException(String message) { + super(message); + // TODO Auto-generated constructor stub + } + + /** + * @param cause + */ + public PermissionDeniedException(Throwable cause) { + super(cause); + // TODO Auto-generated constructor stub + } + + /** + * @param message + * @param cause + */ + public PermissionDeniedException(String message, Throwable cause) { + super(message, cause); + // TODO Auto-generated constructor stub + } + +} diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/repository/OAuth2ClientRepository.java b/openid-connect-server/src/main/java/org/mitre/oauth2/repository/OAuth2ClientRepository.java deleted file mode 100644 index 1dd0d8137..000000000 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/repository/OAuth2ClientRepository.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.mitre.oauth2.repository; - -import java.util.Collection; - -import org.mitre.oauth2.model.ClientDetailsEntity; - -public interface OAuth2ClientRepository { - - public ClientDetailsEntity getClientById(String clientId); - - public ClientDetailsEntity saveClient(ClientDetailsEntity client); - - public void deleteClient(ClientDetailsEntity client); - - public ClientDetailsEntity updateClient(String clientId, ClientDetailsEntity client); - - public Collection getAllClients(); - -} diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/repository/impl/JpaOAuth2ClientRepository.java b/openid-connect-server/src/main/java/org/mitre/oauth2/repository/impl/JpaOAuth2ClientRepository.java index 7022270bb..9c5fb6c88 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/repository/impl/JpaOAuth2ClientRepository.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/repository/impl/JpaOAuth2ClientRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.repository.impl; import java.util.Collection; diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/repository/impl/JpaOAuth2TokenRepository.java b/openid-connect-server/src/main/java/org/mitre/oauth2/repository/impl/JpaOAuth2TokenRepository.java index 07420a5af..e85ab8649 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/repository/impl/JpaOAuth2TokenRepository.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/repository/impl/JpaOAuth2TokenRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.repository.impl; import java.util.List; diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ClientDetailsEntityService.java b/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ClientDetailsEntityService.java index bf15428b7..dc3b2d417 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ClientDetailsEntityService.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ClientDetailsEntityService.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.service.impl; import java.util.Collection; diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ProviderTokenService.java b/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ProviderTokenService.java index e5e03abea..b1d450743 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ProviderTokenService.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/service/impl/DefaultOAuth2ProviderTokenService.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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. + ******************************************************************************/ /** * */ diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/view/JSONOAuthClientView.java b/openid-connect-server/src/main/java/org/mitre/oauth2/view/JSONOAuthClientView.java index c73064d0b..cb5ae5190 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/view/JSONOAuthClientView.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/view/JSONOAuthClientView.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.view; import java.io.Writer; diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/view/TokenIntrospection.java b/openid-connect-server/src/main/java/org/mitre/oauth2/view/TokenIntrospection.java index a442079ed..664c262d9 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/view/TokenIntrospection.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/view/TokenIntrospection.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.view; import java.io.Writer; diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/web/IntrospectionEndpoint.java b/openid-connect-server/src/main/java/org/mitre/oauth2/web/IntrospectionEndpoint.java index e47490c39..036ea3e90 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/web/IntrospectionEndpoint.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/web/IntrospectionEndpoint.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.web; import org.mitre.oauth2.model.OAuth2AccessTokenEntity; diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthClientAPI.java b/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthClientAPI.java index 955678af6..9159505a9 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthClientAPI.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthClientAPI.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.web; import java.util.Collection; diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthClientController.java b/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthClientController.java index e6e9f064b..ef88c6335 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthClientController.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthClientController.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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. + ******************************************************************************/ /** * */ diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthConfirmationController.java b/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthConfirmationController.java index 56340ed24..67b78bc6d 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthConfirmationController.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/web/OAuthConfirmationController.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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. + ******************************************************************************/ /** * */ diff --git a/openid-connect-server/src/main/java/org/mitre/oauth2/web/RevocationEndpoint.java b/openid-connect-server/src/main/java/org/mitre/oauth2/web/RevocationEndpoint.java index 324c94f0e..cbb607e80 100644 --- a/openid-connect-server/src/main/java/org/mitre/oauth2/web/RevocationEndpoint.java +++ b/openid-connect-server/src/main/java/org/mitre/oauth2/web/RevocationEndpoint.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.oauth2.web; import org.mitre.oauth2.exception.PermissionDeniedException; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/exception/ExpiredTokenException.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/exception/ExpiredTokenException.java index 1f4970cb9..935792f6f 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/exception/ExpiredTokenException.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/exception/ExpiredTokenException.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.exception; public class ExpiredTokenException extends RuntimeException { diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/exception/InvalidJwtIssuerException.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/exception/InvalidJwtIssuerException.java index a40e69fe5..43dab06e3 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/exception/InvalidJwtIssuerException.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/exception/InvalidJwtIssuerException.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.exception; public class InvalidJwtIssuerException extends RuntimeException { diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/exception/InvalidJwtSignatureException.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/exception/InvalidJwtSignatureException.java index 0a59ace8b..72882c830 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/exception/InvalidJwtSignatureException.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/exception/InvalidJwtSignatureException.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.exception; public class InvalidJwtSignatureException extends RuntimeException { diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaAddressRepository.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaAddressRepository.java index b24e9bf4b..07ceae67f 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaAddressRepository.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaAddressRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository.impl; import static org.mitre.util.jpa.JpaUtil.saveOrUpdate; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaApprovedSiteRepository.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaApprovedSiteRepository.java index 9dc7f3130..b0959d851 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaApprovedSiteRepository.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaApprovedSiteRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository.impl; import static org.mitre.util.jpa.JpaUtil.saveOrUpdate; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaEventRepository.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaEventRepository.java index 7316068bd..f9d0aca88 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaEventRepository.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaEventRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository.impl; import static org.mitre.util.jpa.JpaUtil.saveOrUpdate; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaIdTokenClaimsRepository.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaIdTokenClaimsRepository.java index 88e8c933f..967d3e90c 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaIdTokenClaimsRepository.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaIdTokenClaimsRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository.impl; import static org.mitre.util.jpa.JpaUtil.saveOrUpdate; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaIdTokenRepository.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaIdTokenRepository.java index 576f5c1cd..ead1dd8b3 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaIdTokenRepository.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaIdTokenRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository.impl; import static org.mitre.util.jpa.JpaUtil.saveOrUpdate; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaUserInfoRepository.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaUserInfoRepository.java index a56364887..57c8958c8 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaUserInfoRepository.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaUserInfoRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository.impl; import static org.mitre.util.jpa.JpaUtil.saveOrUpdate; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaWhitelistedSiteRepositiory.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaWhitelistedSiteRepositiory.java index 2d7dd27a2..30563be49 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaWhitelistedSiteRepositiory.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaWhitelistedSiteRepositiory.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository.impl; import static org.mitre.util.jpa.JpaUtil.saveOrUpdate; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaWhitelistedSiteRepository.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaWhitelistedSiteRepository.java index 50584812d..5880622b3 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaWhitelistedSiteRepository.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/repository/impl/JpaWhitelistedSiteRepository.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository.impl; import static org.mitre.util.jpa.JpaUtil.saveOrUpdate; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/AddressService.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/AddressService.java deleted file mode 100644 index b4f9f67cc..000000000 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/AddressService.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.mitre.openid.connect.service; - -import org.mitre.openid.connect.model.Address; - -/** - * Interface for Address service - * - * @author Michael Joseph Walsh - * - */ -public interface AddressService { - - /** - * Save an Address - * - * @param address - * the Address to be saved - */ - public void save(Address address); - - /** - * Get Address for id - * - * @param id - * id for Address - * @return Address for id, or null - */ - public Address getById(Long id); - - /** - * Remove the Address - * - * @param address - * the Address to remove - */ - public void remove(Address address); - - /** - * Remove the Address - * - * @param id - * id for Address to remove - */ - public void removeById(Long id); -} diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/IdTokenService.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/IdTokenService.java deleted file mode 100644 index b0ea7e688..000000000 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/IdTokenService.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.mitre.openid.connect.service; - -import org.mitre.openid.connect.model.IdToken; - -/** - * Interface for IdToken service - * - * @author Michael Joseph Walsh - * - */ -public interface IdTokenService { - - /** - * Save an IdToken - * - * @param idToken - * the IdToken to be saved - */ - public void save(IdToken idToken); - - /** - * Get IdToken for id - * - * @param id - * id for IdToken - * @return IdToken for id, or null - */ - public IdToken getById(Long id); - - /** - * Remove the IdToken - * - * @param idToken - * the IdToken to remove - */ - public void remove(IdToken idToken); - - /** - * Remove the IdToken - * - * @param id - * id for IdToken to remove - */ - public void removeById(Long id); -} diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/AddressServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/AddressServiceImpl.java index 44e854ee0..d31427931 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/AddressServiceImpl.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/AddressServiceImpl.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service.impl; import org.mitre.openid.connect.model.Address; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/ApprovedSiteServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/ApprovedSiteServiceImpl.java index 68913735e..6c7c7134b 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/ApprovedSiteServiceImpl.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/ApprovedSiteServiceImpl.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service.impl; import java.util.Collection; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/EventServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/EventServiceImpl.java index 40c860e46..3884ed759 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/EventServiceImpl.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/EventServiceImpl.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service.impl; import java.util.Collection; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenClaimsServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenClaimsServiceImpl.java index 788c955ca..980d421bf 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenClaimsServiceImpl.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenClaimsServiceImpl.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service.impl; import org.mitre.openid.connect.model.IdTokenClaims; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenServiceImpl.java index 1eee4f34e..cf61a58b8 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenServiceImpl.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/IdTokenServiceImpl.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service.impl; import org.mitre.openid.connect.model.IdToken; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/UserInfoServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/UserInfoServiceImpl.java index 08359f762..45c31fd60 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/UserInfoServiceImpl.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/UserInfoServiceImpl.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service.impl; import org.mitre.openid.connect.model.UserInfo; @@ -56,4 +71,18 @@ public class UserInfoServiceImpl implements UserInfoService { userInfoRepository.removeByUserId(userId); } + /** + * @return the userInfoRepository + */ + public UserInfoRepository getUserInfoRepository() { + return userInfoRepository; + } + + /** + * @param userInfoRepository the userInfoRepository to set + */ + public void setUserInfoRepository(UserInfoRepository userInfoRepository) { + this.userInfoRepository = userInfoRepository; + } + } diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/WhitelistedSiteServiceImpl.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/WhitelistedSiteServiceImpl.java index 96820bde8..fb20cb05b 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/WhitelistedSiteServiceImpl.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/service/impl/WhitelistedSiteServiceImpl.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.service.impl; import org.mitre.openid.connect.model.WhitelistedSite; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/token/ConnectAuthCodeTokenGranter.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/token/ConnectAuthCodeTokenGranter.java index 5286479c6..f3b56d6bb 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/token/ConnectAuthCodeTokenGranter.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/token/ConnectAuthCodeTokenGranter.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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. + ******************************************************************************/ /** * */ diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/token/DummyIdTokenGeneratorService.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/token/DummyIdTokenGeneratorService.java index 63278c966..3134bb936 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/token/DummyIdTokenGeneratorService.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/token/DummyIdTokenGeneratorService.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.token; import java.util.Date; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/token/IdTokenGeneratorService.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/token/IdTokenGeneratorService.java index 102c5ec04..1977d2aab 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/token/IdTokenGeneratorService.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/token/IdTokenGeneratorService.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.token; import org.mitre.openid.connect.model.IdToken; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/token/JdbcUserApprovalHandler.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/token/JdbcUserApprovalHandler.java index c3ce9474a..d3597dca1 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/token/JdbcUserApprovalHandler.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/token/JdbcUserApprovalHandler.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.token; import org.springframework.security.core.Authentication; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/view/JSONIdTokenView.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/view/JSONIdTokenView.java index 160eb02cd..2c29b8b4e 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/view/JSONIdTokenView.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/view/JSONIdTokenView.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.view; import java.io.Writer; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/view/JSONUserInfoView.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/view/JSONUserInfoView.java index a35aea490..706219898 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/view/JSONUserInfoView.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/view/JSONUserInfoView.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.view; import java.io.Writer; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/view/JwkKeyListView.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/view/JwkKeyListView.java index 08aa2567c..1900c301f 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/view/JwkKeyListView.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/view/JwkKeyListView.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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. + ******************************************************************************/ /** * */ diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/CheckIDEndpoint.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/CheckIDEndpoint.java index a7c3e46c9..9eb468bbc 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/CheckIDEndpoint.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/CheckIDEndpoint.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.web; import javax.servlet.http.HttpServletRequest; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ClientAPI.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ClientAPI.java index 269e0fd50..f4ad79dc3 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ClientAPI.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ClientAPI.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.web; import org.springframework.security.access.prepost.PreAuthorize; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/JsonWebKeyEndpoint.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/JsonWebKeyEndpoint.java index aabc48265..1fb1112f8 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/JsonWebKeyEndpoint.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/JsonWebKeyEndpoint.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.web; import java.security.PublicKey; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ManagerController.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ManagerController.java index debe19fe7..e7af95cf4 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ManagerController.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ManagerController.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.web; import org.springframework.stereotype.Controller; diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java index d137b2953..11768c37c 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/UserInfoEndpoint.java @@ -1,69 +1,84 @@ -package org.mitre.openid.connect.web; - -import org.mitre.oauth2.model.ClientDetailsEntity; -import org.mitre.oauth2.model.OAuth2AccessTokenEntity; -import org.mitre.oauth2.service.OAuth2TokenEntityService; -import org.mitre.openid.connect.model.UserInfo; -import org.mitre.openid.connect.service.UserInfoService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.servlet.ModelAndView; - -/** - * OpenID Connect UserInfo endpoint, as specified in Standard sec 5 and Messages sec 2.4. - * - * @author AANGANES - * - */ -@Controller -public class UserInfoEndpoint { - - @Autowired - OAuth2TokenEntityService tokenService; - - @Autowired - UserInfoService userInfoService; - - /** - * Get information about the user as specified in the accessToken->idToken included in this request - * - * @param accessToken the Access Token associated with this request - * @param schema the data schema to use, default is openid - * @param mav the ModelAndView object associated with this request - * @return JSON or JWT response containing UserInfo data - */ - @RequestMapping(value="/userinfo", method= {RequestMethod.GET, RequestMethod.POST}) - public ModelAndView getInfo(@RequestParam("access_token") String accessToken, @RequestParam("schema") String schema, ModelAndView mav) { - - //This will throw the proper error if the token cannot be found - OAuth2AccessTokenEntity token = tokenService.getAccessToken(accessToken); - - if (schema != "openid") { - //openid is the ONLY defined schema and is a required parameter - //Will we be defining other schemas? - //if schema is unrecognized, throw an error? - - } - - String userId = token.getIdToken().getTokenClaims().getUserId(); - - UserInfo userInfo = userInfoService.getByUserId(userId); - - ClientDetailsEntity client = token.getClient(); - - //if client wants plain JSON, give it JSON; if it wants a JWT, give it a JWT - - //If returning JSON - return new ModelAndView("jsonUserInfoView", "userInfo", userInfo); - - // If returning JWT - //Jwt jwt = new Jwt(new JwtHeader(), new JwtClaims(userInfo.toJson()), null); - //sign jwt according to client's userinfo_signed_response_algs parameter - //mav.addObject(jwt); - //return mav; - } - -} +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.web; + +import org.mitre.oauth2.model.ClientDetailsEntity; +import org.mitre.oauth2.model.OAuth2AccessTokenEntity; +import org.mitre.oauth2.service.OAuth2TokenEntityService; +import org.mitre.openid.connect.model.UserInfo; +import org.mitre.openid.connect.service.UserInfoService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.ModelAndView; + +/** + * OpenID Connect UserInfo endpoint, as specified in Standard sec 5 and Messages sec 2.4. + * + * @author AANGANES + * + */ +@Controller +public class UserInfoEndpoint { + + @Autowired + OAuth2TokenEntityService tokenService; + + @Autowired + UserInfoService userInfoService; + + /** + * Get information about the user as specified in the accessToken->idToken included in this request + * + * @param accessToken the Access Token associated with this request + * @param schema the data schema to use, default is openid + * @param mav the ModelAndView object associated with this request + * @return JSON or JWT response containing UserInfo data + */ + @RequestMapping(value="/userinfo", method= {RequestMethod.GET, RequestMethod.POST}) + public ModelAndView getInfo(@RequestParam("access_token") String accessToken, @RequestParam("schema") String schema, ModelAndView mav) { + + //This will throw the proper error if the token cannot be found + OAuth2AccessTokenEntity token = tokenService.getAccessToken(accessToken); + + if (schema != "openid") { + //openid is the ONLY defined schema and is a required parameter + //Will we be defining other schemas? + //if schema is unrecognized, throw an error? + + } + + String userId = token.getIdToken().getTokenClaims().getUserId(); + + UserInfo userInfo = userInfoService.getByUserId(userId); + + ClientDetailsEntity client = token.getClient(); + + //if client wants plain JSON, give it JSON; if it wants a JWT, give it a JWT + + //If returning JSON + return new ModelAndView("jsonUserInfoView", "userInfo", userInfo); + + // If returning JWT + //Jwt jwt = new Jwt(new JwtHeader(), new JwtClaims(userInfo.toJson()), null); + //sign jwt according to client's userinfo_signed_response_algs parameter + //mav.addObject(jwt); + //return mav; + } + +} diff --git a/openid-connect-server/src/main/java/org/mitre/swd/view/JsonOpenIdConfigurationView.java b/openid-connect-server/src/main/java/org/mitre/swd/view/JsonOpenIdConfigurationView.java index 6182155e7..7189cec29 100644 --- a/openid-connect-server/src/main/java/org/mitre/swd/view/JsonOpenIdConfigurationView.java +++ b/openid-connect-server/src/main/java/org/mitre/swd/view/JsonOpenIdConfigurationView.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.swd.view; import java.io.Writer; diff --git a/openid-connect-server/src/main/java/org/mitre/swd/view/SwdResponse.java b/openid-connect-server/src/main/java/org/mitre/swd/view/SwdResponse.java index 82d2b3bf4..047473a10 100644 --- a/openid-connect-server/src/main/java/org/mitre/swd/view/SwdResponse.java +++ b/openid-connect-server/src/main/java/org/mitre/swd/view/SwdResponse.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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. + ******************************************************************************/ /** * */ diff --git a/openid-connect-server/src/main/java/org/mitre/swd/web/SimpleWebDiscoveryEndpoint.java b/openid-connect-server/src/main/java/org/mitre/swd/web/SimpleWebDiscoveryEndpoint.java index 273c64762..e20af27ff 100644 --- a/openid-connect-server/src/main/java/org/mitre/swd/web/SimpleWebDiscoveryEndpoint.java +++ b/openid-connect-server/src/main/java/org/mitre/swd/web/SimpleWebDiscoveryEndpoint.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.swd.web; import java.util.HashMap; diff --git a/openid-connect-server/src/test/java/org/mitre/jwt/JwtTest.java b/openid-connect-server/src/test/java/org/mitre/jwt/JwtTest.java index 5de8aa23e..f565fbd33 100644 --- a/openid-connect-server/src/test/java/org/mitre/jwt/JwtTest.java +++ b/openid-connect-server/src/test/java/org/mitre/jwt/JwtTest.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/openid-connect-server/src/test/java/org/mitre/jwt/signer/service/impl/KeyStoreTest.java b/openid-connect-server/src/test/java/org/mitre/jwt/signer/service/impl/KeyStoreTest.java index f94aa2c80..72fd84ce5 100644 --- a/openid-connect-server/src/test/java/org/mitre/jwt/signer/service/impl/KeyStoreTest.java +++ b/openid-connect-server/src/test/java/org/mitre/jwt/signer/service/impl/KeyStoreTest.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.jwt.signer.service.impl; import static org.hamcrest.CoreMatchers.not; diff --git a/openid-connect-server/src/test/java/org/mitre/openid/connect/repository/AddressRepositoryTest.java b/openid-connect-server/src/test/java/org/mitre/openid/connect/repository/AddressRepositoryTest.java index 908dc68b4..18e995716 100644 --- a/openid-connect-server/src/test/java/org/mitre/openid/connect/repository/AddressRepositoryTest.java +++ b/openid-connect-server/src/test/java/org/mitre/openid/connect/repository/AddressRepositoryTest.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository; import static org.hamcrest.CoreMatchers.equalTo; diff --git a/openid-connect-server/src/test/java/org/mitre/openid/connect/repository/EventRepositoryTest.java b/openid-connect-server/src/test/java/org/mitre/openid/connect/repository/EventRepositoryTest.java index cf0a4b0ff..e946f76f6 100644 --- a/openid-connect-server/src/test/java/org/mitre/openid/connect/repository/EventRepositoryTest.java +++ b/openid-connect-server/src/test/java/org/mitre/openid/connect/repository/EventRepositoryTest.java @@ -1,3 +1,18 @@ +/******************************************************************************* + * Copyright 2012 The MITRE Corporation + * + * 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.openid.connect.repository; import static org.hamcrest.CoreMatchers.equalTo; @@ -148,4 +163,4 @@ public class EventRepositoryTest { repository.removeById(42L); } -} \ No newline at end of file +}