added copyright to all java files. closes #11
parent
6724866099
commit
97dffb6414
|
@ -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;
|
package org.mitre.openid.connect.client;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.client;
|
||||||
|
|
||||||
import org.springframework.beans.factory.InitializingBean;
|
import org.springframework.beans.factory.InitializingBean;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.client;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
@ -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;
|
package org.mitre.jdbc.datasource;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
|
@ -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;
|
package org.mitre.jdbc.datasource.util;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
|
@ -146,4 +161,4 @@ public class SqlFileParser {
|
||||||
Matcher match = WORD_PATTERN.matcher(line);
|
Matcher match = WORD_PATTERN.matcher(line);
|
||||||
return match.find() ? match.group(1) : null;
|
return match.find() ? match.group(1) : null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
package org.mitre.jwt.model;
|
||||||
|
|
||||||
import java.io.ByteArrayInputStream;
|
import java.io.ByteArrayInputStream;
|
||||||
|
|
|
@ -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;
|
package org.mitre.jwt.model;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,204 +1,219 @@
|
||||||
package org.mitre.jwt.model;
|
/*******************************************************************************
|
||||||
|
* Copyright 2012 The MITRE Corporation
|
||||||
import java.text.DateFormat;
|
*
|
||||||
import java.text.ParseException;
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
import java.text.SimpleDateFormat;
|
* you may not use this file except in compliance with the License.
|
||||||
import java.util.Date;
|
* You may obtain a copy of the License at
|
||||||
import java.util.HashMap;
|
*
|
||||||
import java.util.Map;
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
import java.util.Map.Entry;
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
import com.google.gson.JsonElement;
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
import com.google.gson.JsonObject;
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
import com.google.gson.JsonPrimitive;
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
public class JwtClaims extends ClaimSet {
|
******************************************************************************/
|
||||||
|
package org.mitre.jwt.model;
|
||||||
public static final String TYPE = "typ";
|
|
||||||
public static final String JWT_ID = "jti";
|
import java.text.DateFormat;
|
||||||
public static final String PRINCIPAL = "prn";
|
import java.text.ParseException;
|
||||||
public static final String AUDIENCE = "aud";
|
import java.text.SimpleDateFormat;
|
||||||
public static final String ISSUER = "iss";
|
import java.util.Date;
|
||||||
public static final String ISSUED_AT = "iat";
|
import java.util.HashMap;
|
||||||
public static final String NOT_BEFORE = "nbf";
|
import java.util.Map;
|
||||||
public static final String EXPIRATION = "exp";
|
import java.util.Map.Entry;
|
||||||
public static final String NONCE = "nonce";
|
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
/**
|
import com.google.gson.JsonObject;
|
||||||
* ISO8601 / RFC3339 Date Format
|
import com.google.gson.JsonPrimitive;
|
||||||
*/
|
|
||||||
//public static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz");
|
public class JwtClaims extends ClaimSet {
|
||||||
|
|
||||||
public JwtClaims() {
|
public static final String TYPE = "typ";
|
||||||
super();
|
public static final String JWT_ID = "jti";
|
||||||
}
|
public static final String PRINCIPAL = "prn";
|
||||||
|
public static final String AUDIENCE = "aud";
|
||||||
public JwtClaims(JsonObject json) {
|
public static final String ISSUER = "iss";
|
||||||
super(json);
|
public static final String ISSUED_AT = "iat";
|
||||||
}
|
public static final String NOT_BEFORE = "nbf";
|
||||||
|
public static final String EXPIRATION = "exp";
|
||||||
public JwtClaims(String b64) {
|
public static final String NONCE = "nonce";
|
||||||
super(b64);
|
|
||||||
}
|
/**
|
||||||
|
* ISO8601 / RFC3339 Date Format
|
||||||
@Override
|
*/
|
||||||
public void loadFromJsonObject(JsonObject json) {
|
//public static DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssz");
|
||||||
JsonObject pass = new JsonObject();
|
|
||||||
|
public JwtClaims() {
|
||||||
for (Entry<String, JsonElement> element : json.entrySet()) {
|
super();
|
||||||
if (element.getValue().isJsonNull()) {
|
}
|
||||||
pass.add(element.getKey(), element.getValue());
|
|
||||||
} else if (element.getKey().equals(EXPIRATION)) {
|
public JwtClaims(JsonObject json) {
|
||||||
setExpiration(new Date(element.getValue().getAsLong() * 1000L));
|
super(json);
|
||||||
} else if (element.getKey().equals(NOT_BEFORE)) {
|
}
|
||||||
setNotBefore(new Date(element.getValue().getAsLong() * 1000L));
|
|
||||||
} else if (element.getKey().equals(ISSUED_AT)) {
|
public JwtClaims(String b64) {
|
||||||
setIssuedAt(new Date(element.getValue().getAsLong() * 1000L));
|
super(b64);
|
||||||
} else if (element.getKey().equals(ISSUER)) {
|
}
|
||||||
setIssuer(element.getValue().getAsString());
|
|
||||||
} else if (element.getKey().equals(AUDIENCE)) {
|
@Override
|
||||||
setAudience(element.getValue().getAsString());
|
public void loadFromJsonObject(JsonObject json) {
|
||||||
} else if (element.getKey().equals(PRINCIPAL)) {
|
JsonObject pass = new JsonObject();
|
||||||
setPrincipal(element.getValue().getAsString());
|
|
||||||
} else if (element.getKey().equals(JWT_ID)) {
|
for (Entry<String, JsonElement> element : json.entrySet()) {
|
||||||
setJwtId(element.getValue().getAsString());
|
if (element.getValue().isJsonNull()) {
|
||||||
} else if (element.getKey().equals(TYPE)) {
|
pass.add(element.getKey(), element.getValue());
|
||||||
setType(element.getValue().getAsString());
|
} else if (element.getKey().equals(EXPIRATION)) {
|
||||||
} else if (element.getKey().equals(NONCE)){
|
setExpiration(new Date(element.getValue().getAsLong() * 1000L));
|
||||||
setType(element.getValue().getAsString());
|
} else if (element.getKey().equals(NOT_BEFORE)) {
|
||||||
}else {
|
setNotBefore(new Date(element.getValue().getAsLong() * 1000L));
|
||||||
pass.add(element.getKey(), element.getValue());
|
} else if (element.getKey().equals(ISSUED_AT)) {
|
||||||
}
|
setIssuedAt(new Date(element.getValue().getAsLong() * 1000L));
|
||||||
}
|
} else if (element.getKey().equals(ISSUER)) {
|
||||||
|
setIssuer(element.getValue().getAsString());
|
||||||
// load all the generic claims into this object
|
} else if (element.getKey().equals(AUDIENCE)) {
|
||||||
super.loadFromJsonObject(pass);
|
setAudience(element.getValue().getAsString());
|
||||||
}
|
} else if (element.getKey().equals(PRINCIPAL)) {
|
||||||
|
setPrincipal(element.getValue().getAsString());
|
||||||
/**
|
} else if (element.getKey().equals(JWT_ID)) {
|
||||||
* @return the expiration
|
setJwtId(element.getValue().getAsString());
|
||||||
*/
|
} else if (element.getKey().equals(TYPE)) {
|
||||||
public Date getExpiration() {
|
setType(element.getValue().getAsString());
|
||||||
return getClaimAsDate(EXPIRATION);
|
} else if (element.getKey().equals(NONCE)){
|
||||||
}
|
setType(element.getValue().getAsString());
|
||||||
|
}else {
|
||||||
/**
|
pass.add(element.getKey(), element.getValue());
|
||||||
* @param expiration the expiration to set
|
}
|
||||||
*/
|
}
|
||||||
public void setExpiration(Date expiration) {
|
|
||||||
setClaim(EXPIRATION, expiration);
|
// load all the generic claims into this object
|
||||||
}
|
super.loadFromJsonObject(pass);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return the notBefore
|
/**
|
||||||
*/
|
* @return the expiration
|
||||||
public Date getNotBefore() {
|
*/
|
||||||
return getClaimAsDate(NOT_BEFORE);
|
public Date getExpiration() {
|
||||||
}
|
return getClaimAsDate(EXPIRATION);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @param notBefore the notBefore to set
|
/**
|
||||||
*/
|
* @param expiration the expiration to set
|
||||||
public void setNotBefore(Date notBefore) {
|
*/
|
||||||
setClaim(NOT_BEFORE, notBefore);
|
public void setExpiration(Date expiration) {
|
||||||
}
|
setClaim(EXPIRATION, expiration);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return the issuedAt
|
/**
|
||||||
*/
|
* @return the notBefore
|
||||||
public Date getIssuedAt() {
|
*/
|
||||||
return getClaimAsDate(ISSUED_AT);
|
public Date getNotBefore() {
|
||||||
}
|
return getClaimAsDate(NOT_BEFORE);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @param issuedAt the issuedAt to set
|
/**
|
||||||
*/
|
* @param notBefore the notBefore to set
|
||||||
public void setIssuedAt(Date issuedAt) {
|
*/
|
||||||
setClaim(ISSUED_AT, issuedAt);
|
public void setNotBefore(Date notBefore) {
|
||||||
}
|
setClaim(NOT_BEFORE, notBefore);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return the issuer
|
/**
|
||||||
*/
|
* @return the issuedAt
|
||||||
public String getIssuer() {
|
*/
|
||||||
return getClaimAsString(ISSUER);
|
public Date getIssuedAt() {
|
||||||
}
|
return getClaimAsDate(ISSUED_AT);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @param issuer the issuer to set
|
/**
|
||||||
*/
|
* @param issuedAt the issuedAt to set
|
||||||
public void setIssuer(String issuer) {
|
*/
|
||||||
setClaim(ISSUER, issuer);
|
public void setIssuedAt(Date issuedAt) {
|
||||||
}
|
setClaim(ISSUED_AT, issuedAt);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return the audience
|
/**
|
||||||
*/
|
* @return the issuer
|
||||||
public String getAudience() {
|
*/
|
||||||
return getClaimAsString(AUDIENCE);
|
public String getIssuer() {
|
||||||
}
|
return getClaimAsString(ISSUER);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @param audience the audience to set
|
/**
|
||||||
*/
|
* @param issuer the issuer to set
|
||||||
public void setAudience(String audience) {
|
*/
|
||||||
setClaim(AUDIENCE, audience);
|
public void setIssuer(String issuer) {
|
||||||
}
|
setClaim(ISSUER, issuer);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return the principal
|
/**
|
||||||
*/
|
* @return the audience
|
||||||
public String getPrincipal() {
|
*/
|
||||||
return getClaimAsString(PRINCIPAL);
|
public String getAudience() {
|
||||||
}
|
return getClaimAsString(AUDIENCE);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @param principal the principal to set
|
/**
|
||||||
*/
|
* @param audience the audience to set
|
||||||
public void setPrincipal(String principal) {
|
*/
|
||||||
setClaim(AUDIENCE, principal);
|
public void setAudience(String audience) {
|
||||||
}
|
setClaim(AUDIENCE, audience);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return the jwtId
|
/**
|
||||||
*/
|
* @return the principal
|
||||||
public String getJwtId() {
|
*/
|
||||||
return getClaimAsString(JWT_ID);
|
public String getPrincipal() {
|
||||||
}
|
return getClaimAsString(PRINCIPAL);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @param jwtId the jwtId to set
|
/**
|
||||||
*/
|
* @param principal the principal to set
|
||||||
public void setJwtId(String jwtId) {
|
*/
|
||||||
setClaim(JWT_ID, jwtId);
|
public void setPrincipal(String principal) {
|
||||||
}
|
setClaim(AUDIENCE, principal);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return the type
|
/**
|
||||||
*/
|
* @return the jwtId
|
||||||
public String getType() {
|
*/
|
||||||
return getClaimAsString(TYPE);
|
public String getJwtId() {
|
||||||
}
|
return getClaimAsString(JWT_ID);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @param type the type to set
|
/**
|
||||||
*/
|
* @param jwtId the jwtId to set
|
||||||
public void setType(String type) {
|
*/
|
||||||
setClaim(TYPE, type);
|
public void setJwtId(String jwtId) {
|
||||||
}
|
setClaim(JWT_ID, jwtId);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @return the nonce
|
/**
|
||||||
*/
|
* @return the type
|
||||||
public String getNonce() {
|
*/
|
||||||
return getClaimAsString(NONCE);
|
public String getType() {
|
||||||
}
|
return getClaimAsString(TYPE);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* @param nonce the nonce to set
|
/**
|
||||||
*/
|
* @param type the type to set
|
||||||
public void setNonce(String nonce) {
|
*/
|
||||||
setClaim(NONCE, nonce);
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -1,110 +1,125 @@
|
||||||
package org.mitre.jwt.model;
|
/*******************************************************************************
|
||||||
|
* Copyright 2012 The MITRE Corporation
|
||||||
import java.util.HashMap;
|
*
|
||||||
import java.util.Map;
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
import java.util.Map.Entry;
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
import com.google.gson.JsonElement;
|
*
|
||||||
import com.google.gson.JsonObject;
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
import com.google.gson.JsonPrimitive;
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
public class JwtHeader extends ClaimSet {
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
public static final String TYPE = "typ";
|
* See the License for the specific language governing permissions and
|
||||||
public static final String ALGORITHM = "alg";
|
* limitations under the License.
|
||||||
public static final String ENCRYPTION_METHOD = "enc";
|
******************************************************************************/
|
||||||
|
package org.mitre.jwt.model;
|
||||||
/**
|
|
||||||
* Make an empty header
|
import java.util.HashMap;
|
||||||
*/
|
import java.util.Map;
|
||||||
public JwtHeader() {
|
import java.util.Map.Entry;
|
||||||
super();
|
|
||||||
}
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
/**
|
import com.google.gson.JsonPrimitive;
|
||||||
* Build a header from a JSON object
|
|
||||||
* @param json
|
public class JwtHeader extends ClaimSet {
|
||||||
*/
|
|
||||||
public JwtHeader(JsonObject json) {
|
public static final String TYPE = "typ";
|
||||||
super(json);
|
public static final String ALGORITHM = "alg";
|
||||||
}
|
public static final String ENCRYPTION_METHOD = "enc";
|
||||||
|
|
||||||
|
/**
|
||||||
public JwtHeader(String b64) {
|
* Make an empty header
|
||||||
super(b64);
|
*/
|
||||||
}
|
public JwtHeader() {
|
||||||
|
super();
|
||||||
/**
|
}
|
||||||
* Load all claims from the given json object into this object
|
|
||||||
*/
|
/**
|
||||||
@Override
|
* Build a header from a JSON object
|
||||||
public void loadFromJsonObject(JsonObject json) {
|
* @param json
|
||||||
|
*/
|
||||||
JsonObject pass = new JsonObject();
|
public JwtHeader(JsonObject json) {
|
||||||
|
super(json);
|
||||||
for (Entry<String, JsonElement> element : json.entrySet()) {
|
}
|
||||||
if (element.getValue().isJsonNull()) {
|
|
||||||
pass.add(element.getKey(), element.getValue());
|
|
||||||
} else if (element.getKey().equals(TYPE)) {
|
public JwtHeader(String b64) {
|
||||||
this.setType(json.get(TYPE).getAsString());
|
super(b64);
|
||||||
} 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());
|
* Load all claims from the given json object into this object
|
||||||
} else {
|
*/
|
||||||
pass.add(element.getKey(), element.getValue());
|
@Override
|
||||||
}
|
public void loadFromJsonObject(JsonObject json) {
|
||||||
}
|
|
||||||
|
JsonObject pass = new JsonObject();
|
||||||
// now load all the ones we didn't handle specially
|
|
||||||
super.loadFromJsonObject(pass);
|
for (Entry<String, JsonElement> element : json.entrySet()) {
|
||||||
}
|
if (element.getValue().isJsonNull()) {
|
||||||
|
pass.add(element.getKey(), element.getValue());
|
||||||
/**
|
} else if (element.getKey().equals(TYPE)) {
|
||||||
* @return the type
|
this.setType(json.get(TYPE).getAsString());
|
||||||
*/
|
} else if (element.getKey().equals(ALGORITHM)) {
|
||||||
public String getType() {
|
this.setAlgorithm(json.get(ALGORITHM).getAsString());
|
||||||
return getClaimAsString(TYPE);
|
} else if (element.getKey().equals(ENCRYPTION_METHOD)) {
|
||||||
}
|
this.setEncryptionMethod(json.get(ENCRYPTION_METHOD).getAsString());
|
||||||
|
} else {
|
||||||
|
pass.add(element.getKey(), element.getValue());
|
||||||
/**
|
}
|
||||||
* @param type the type to set
|
}
|
||||||
*/
|
|
||||||
public void setType(String type) {
|
// now load all the ones we didn't handle specially
|
||||||
setClaim(TYPE, type);
|
super.loadFromJsonObject(pass);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
* @return the type
|
||||||
* @return the algorithm
|
*/
|
||||||
*/
|
public String getType() {
|
||||||
public String getAlgorithm() {
|
return getClaimAsString(TYPE);
|
||||||
return getClaimAsString(ALGORITHM);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
* @param type the type to set
|
||||||
* @param algorithm the algorithm to set
|
*/
|
||||||
*/
|
public void setType(String type) {
|
||||||
public void setAlgorithm(String algorithm) {
|
setClaim(TYPE, type);
|
||||||
setClaim(ALGORITHM, algorithm);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
* @return the algorithm
|
||||||
* @return the encryptionMethod
|
*/
|
||||||
*/
|
public String getAlgorithm() {
|
||||||
public String getEncryptionMethod() {
|
return getClaimAsString(ALGORITHM);
|
||||||
return getClaimAsString(ENCRYPTION_METHOD);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
/**
|
* @param algorithm the algorithm to set
|
||||||
* @param encryptionMethod the encryptionMethod to set
|
*/
|
||||||
*/
|
public void setAlgorithm(String algorithm) {
|
||||||
public void setEncryptionMethod(String encryptionMethod) {
|
setClaim(ALGORITHM, algorithm);
|
||||||
setClaim(ENCRYPTION_METHOD, encryptionMethod);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
}
|
/**
|
||||||
|
* @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);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -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;
|
package org.mitre.jwt.signer;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -78,4 +93,4 @@ public abstract class AbstractJwtSigner implements JwtSigner {
|
||||||
|
|
||||||
|
|
||||||
protected abstract String generateSignature(String signatureBase);
|
protected abstract String generateSignature(String signatureBase);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
package org.mitre.jwt.signer;
|
||||||
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
|
|
|
@ -1,11 +1,26 @@
|
||||||
package org.mitre.jwt.signer;
|
/*******************************************************************************
|
||||||
|
* Copyright 2012 The MITRE Corporation
|
||||||
import org.mitre.jwt.model.Jwt;
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
public interface JwtSigner {
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
public Jwt sign(Jwt jwt);
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
public boolean verify(String jwtString);
|
*
|
||||||
|
* 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);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -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;
|
package org.mitre.jwt.signer.impl;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
@ -166,4 +181,4 @@ public class HmacSigner extends AbstractJwtSigner implements InitializingBean {
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "HmacSigner [mac=" + mac + ", passphrase=" + passphrase + "]";
|
return "HmacSigner [mac=" + mac + ", passphrase=" + passphrase + "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
package org.mitre.jwt.signer.impl;
|
||||||
|
|
||||||
import org.mitre.jwt.signer.AbstractJwtSigner;
|
import org.mitre.jwt.signer.AbstractJwtSigner;
|
||||||
|
|
|
@ -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;
|
package org.mitre.jwt.signer.impl;
|
||||||
|
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
|
@ -262,4 +277,4 @@ public class RsaSigner extends AbstractJwtSigner implements InitializingBean {
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
package org.mitre.jwt.signer.service;
|
||||||
|
|
||||||
import java.security.PublicKey;
|
import java.security.PublicKey;
|
||||||
|
|
|
@ -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;
|
package org.mitre.jwt.signer.service.impl;
|
||||||
|
|
||||||
import java.security.PublicKey;
|
import java.security.PublicKey;
|
||||||
|
|
|
@ -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;
|
package org.mitre.jwt.signer.service.impl;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
|
@ -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.
|
||||||
|
******************************************************************************/
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.model;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.model;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -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.
|
||||||
|
******************************************************************************/
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.model;
|
||||||
|
|
||||||
public interface OAuth2AccessTokenEntityFactory {
|
public interface OAuth2AccessTokenEntityFactory {
|
||||||
|
|
|
@ -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.
|
||||||
|
******************************************************************************/
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.model;
|
||||||
|
|
||||||
public interface OAuth2RefreshTokenEntityFactory {
|
public interface OAuth2RefreshTokenEntityFactory {
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.model;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.repository;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.repository;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.service;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.config;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,123 +1,138 @@
|
||||||
package org.mitre.openid.connect.model;
|
/*******************************************************************************
|
||||||
|
* Copyright 2012 The MITRE Corporation
|
||||||
import javax.persistence.Basic;
|
*
|
||||||
import javax.persistence.Entity;
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
import javax.persistence.GeneratedValue;
|
* you may not use this file except in compliance with the License.
|
||||||
import javax.persistence.GenerationType;
|
* You may obtain a copy of the License at
|
||||||
import javax.persistence.Id;
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
@Entity
|
*
|
||||||
public class Address {
|
* 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.
|
||||||
private Long id;
|
* See the License for the specific language governing permissions and
|
||||||
private String formatted;
|
* limitations under the License.
|
||||||
private String streetAddress;
|
******************************************************************************/
|
||||||
private String locality;
|
package org.mitre.openid.connect.model;
|
||||||
private String region;
|
|
||||||
private String postalCode;
|
import javax.persistence.Basic;
|
||||||
private String country;
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
/**
|
import javax.persistence.GenerationType;
|
||||||
* Empty constructor
|
import javax.persistence.Id;
|
||||||
*/
|
|
||||||
public Address() {
|
@Entity
|
||||||
|
public class Address {
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
private Long id;
|
||||||
* @return the formatted address string
|
private String formatted;
|
||||||
*/
|
private String streetAddress;
|
||||||
@Basic
|
private String locality;
|
||||||
public String getFormatted() {
|
private String region;
|
||||||
return formatted;
|
private String postalCode;
|
||||||
}
|
private String country;
|
||||||
/**
|
|
||||||
* @param formatted the formatted address to set
|
/**
|
||||||
*/
|
* Empty constructor
|
||||||
public void setFormatted(String formatted) {
|
*/
|
||||||
this.formatted = formatted;
|
public Address() {
|
||||||
}
|
|
||||||
/**
|
}
|
||||||
* @return the streetAddress
|
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the formatted address string
|
||||||
public String getStreetAddress() {
|
*/
|
||||||
return streetAddress;
|
@Basic
|
||||||
}
|
public String getFormatted() {
|
||||||
/**
|
return formatted;
|
||||||
* @param streetAddress the streetAddress to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setStreetAddress(String streetAddress) {
|
* @param formatted the formatted address to set
|
||||||
this.streetAddress = streetAddress;
|
*/
|
||||||
}
|
public void setFormatted(String formatted) {
|
||||||
/**
|
this.formatted = formatted;
|
||||||
* @return the locality
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the streetAddress
|
||||||
public String getLocality() {
|
*/
|
||||||
return locality;
|
@Basic
|
||||||
}
|
public String getStreetAddress() {
|
||||||
/**
|
return streetAddress;
|
||||||
* @param locality the locality to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setLocality(String locality) {
|
* @param streetAddress the streetAddress to set
|
||||||
this.locality = locality;
|
*/
|
||||||
}
|
public void setStreetAddress(String streetAddress) {
|
||||||
/**
|
this.streetAddress = streetAddress;
|
||||||
* @return the region
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the locality
|
||||||
public String getRegion() {
|
*/
|
||||||
return region;
|
@Basic
|
||||||
}
|
public String getLocality() {
|
||||||
/**
|
return locality;
|
||||||
* @param region the region to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setRegion(String region) {
|
* @param locality the locality to set
|
||||||
this.region = region;
|
*/
|
||||||
}
|
public void setLocality(String locality) {
|
||||||
/**
|
this.locality = locality;
|
||||||
* @return the postalCode
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the region
|
||||||
public String getPostalCode() {
|
*/
|
||||||
return postalCode;
|
@Basic
|
||||||
}
|
public String getRegion() {
|
||||||
/**
|
return region;
|
||||||
* @param postalCode the postalCode to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setPostalCode(String postalCode) {
|
* @param region the region to set
|
||||||
this.postalCode = postalCode;
|
*/
|
||||||
}
|
public void setRegion(String region) {
|
||||||
/**
|
this.region = region;
|
||||||
* @return the country
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the postalCode
|
||||||
public String getCountry() {
|
*/
|
||||||
return country;
|
@Basic
|
||||||
}
|
public String getPostalCode() {
|
||||||
/**
|
return postalCode;
|
||||||
* @param country the country to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setCountry(String country) {
|
* @param postalCode the postalCode to set
|
||||||
this.country = country;
|
*/
|
||||||
}
|
public void setPostalCode(String postalCode) {
|
||||||
|
this.postalCode = postalCode;
|
||||||
/**
|
}
|
||||||
* @return the id
|
/**
|
||||||
*/
|
* @return the country
|
||||||
@Id
|
*/
|
||||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
@Basic
|
||||||
public Long getId() {
|
public String getCountry() {
|
||||||
return id;
|
return country;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
/**
|
* @param country the country to set
|
||||||
* @param id the id to set
|
*/
|
||||||
*/
|
public void setCountry(String country) {
|
||||||
public void setId(Long id) {
|
this.country = country;
|
||||||
this.id = id;
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
}
|
* @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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.model;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.model;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.model;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,154 +1,169 @@
|
||||||
package org.mitre.openid.connect.model;
|
/*******************************************************************************
|
||||||
|
* Copyright 2012 The MITRE Corporation
|
||||||
import java.util.Date;
|
*
|
||||||
import java.util.Map.Entry;
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
import javax.persistence.Basic;
|
* You may obtain a copy of the License at
|
||||||
import javax.persistence.Entity;
|
*
|
||||||
import javax.persistence.GeneratedValue;
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
import javax.persistence.GenerationType;
|
*
|
||||||
import javax.persistence.Id;
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
import javax.persistence.Table;
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
import javax.persistence.Transient;
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
import org.mitre.jwt.model.JwtClaims;
|
* limitations under the License.
|
||||||
|
******************************************************************************/
|
||||||
import com.google.gson.JsonElement;
|
package org.mitre.openid.connect.model;
|
||||||
import com.google.gson.JsonObject;
|
|
||||||
import com.google.gson.JsonParser;
|
import java.util.Date;
|
||||||
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
@Entity
|
import javax.persistence.Basic;
|
||||||
@Table(name="idtokenclaims")
|
import javax.persistence.Entity;
|
||||||
public class IdTokenClaims extends JwtClaims {
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.GenerationType;
|
||||||
public static final String USER_ID = "user_id";
|
import javax.persistence.Id;
|
||||||
public static final String AUTHENTICATION_CONTEXT_CLASS_REFERENCE = "acr";
|
import javax.persistence.Table;
|
||||||
public static final String NONCE = "nonce";
|
import javax.persistence.Transient;
|
||||||
public static final String AUTH_TIME = "auth_time";
|
|
||||||
|
import org.mitre.jwt.model.JwtClaims;
|
||||||
private Long id;
|
|
||||||
|
import com.google.gson.JsonElement;
|
||||||
|
import com.google.gson.JsonObject;
|
||||||
|
import com.google.gson.JsonParser;
|
||||||
public IdTokenClaims() {
|
|
||||||
super();
|
|
||||||
}
|
@Entity
|
||||||
|
@Table(name="idtokenclaims")
|
||||||
public IdTokenClaims(JsonObject json) {
|
public class IdTokenClaims extends JwtClaims {
|
||||||
super(json);
|
|
||||||
}
|
public static final String USER_ID = "user_id";
|
||||||
|
public static final String AUTHENTICATION_CONTEXT_CLASS_REFERENCE = "acr";
|
||||||
public IdTokenClaims(String b64) {
|
public static final String NONCE = "nonce";
|
||||||
super(b64);
|
public static final String AUTH_TIME = "auth_time";
|
||||||
}
|
|
||||||
|
private Long id;
|
||||||
/**
|
|
||||||
* @return the id
|
|
||||||
*/
|
|
||||||
@Id
|
public IdTokenClaims() {
|
||||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
super();
|
||||||
public Long getId() {
|
}
|
||||||
return id;
|
|
||||||
}
|
public IdTokenClaims(JsonObject json) {
|
||||||
/**
|
super(json);
|
||||||
* @param id the id to set
|
}
|
||||||
*/
|
|
||||||
public void setId(Long id) {
|
public IdTokenClaims(String b64) {
|
||||||
this.id = id;
|
super(b64);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transient
|
/**
|
||||||
public String getUserId() {
|
* @return the id
|
||||||
return getClaimAsString(USER_ID);
|
*/
|
||||||
}
|
@Id
|
||||||
|
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||||
public void setUserId(String user_id) {
|
public Long getId() {
|
||||||
setClaim(USER_ID, user_id);
|
return id;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
@Transient
|
* @param id the id to set
|
||||||
public String getAuthContext() {
|
*/
|
||||||
return getClaimAsString(AUTHENTICATION_CONTEXT_CLASS_REFERENCE);
|
public void setId(Long id) {
|
||||||
}
|
this.id = id;
|
||||||
|
}
|
||||||
public void setAuthContext(String acr) {
|
|
||||||
setClaim(AUTHENTICATION_CONTEXT_CLASS_REFERENCE, acr);
|
@Transient
|
||||||
}
|
public String getUserId() {
|
||||||
|
return getClaimAsString(USER_ID);
|
||||||
@Transient
|
}
|
||||||
public String getNonce() {
|
|
||||||
return getClaimAsString(NONCE);
|
public void setUserId(String user_id) {
|
||||||
}
|
setClaim(USER_ID, user_id);
|
||||||
|
}
|
||||||
public void setNonce(String nonce) {
|
|
||||||
setClaim(NONCE, nonce);
|
@Transient
|
||||||
}
|
public String getAuthContext() {
|
||||||
|
return getClaimAsString(AUTHENTICATION_CONTEXT_CLASS_REFERENCE);
|
||||||
@Transient
|
}
|
||||||
public Date getAuthTime() {
|
|
||||||
return getClaimAsDate(AUTH_TIME);
|
public void setAuthContext(String acr) {
|
||||||
}
|
setClaim(AUTHENTICATION_CONTEXT_CLASS_REFERENCE, acr);
|
||||||
|
}
|
||||||
public void setAuthTime(Date authTime) {
|
|
||||||
setClaim(AUTH_TIME, authTime);
|
@Transient
|
||||||
}
|
public String getNonce() {
|
||||||
|
return getClaimAsString(NONCE);
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Get the seraialized form of this claim set
|
public void setNonce(String nonce) {
|
||||||
*/
|
setClaim(NONCE, nonce);
|
||||||
@Basic
|
}
|
||||||
public String getSerializedForm() {
|
|
||||||
// TODO Auto-generated method stub
|
@Transient
|
||||||
JsonObject o = super.getAsJsonObject();
|
public Date getAuthTime() {
|
||||||
|
return getClaimAsDate(AUTH_TIME);
|
||||||
return o.toString();
|
}
|
||||||
}
|
|
||||||
|
public void setAuthTime(Date authTime) {
|
||||||
/**
|
setClaim(AUTH_TIME, authTime);
|
||||||
* 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) {
|
* Get the seraialized form of this claim set
|
||||||
JsonParser parser = new JsonParser();
|
*/
|
||||||
JsonElement json = parser.parse(s);
|
@Basic
|
||||||
if (json != null && json.isJsonObject()) {
|
public String getSerializedForm() {
|
||||||
loadFromJsonObject(json.getAsJsonObject());
|
// TODO Auto-generated method stub
|
||||||
} else {
|
JsonObject o = super.getAsJsonObject();
|
||||||
throw new IllegalArgumentException("Could not parse: " + s);
|
|
||||||
}
|
return o.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
/**
|
||||||
// FIXME:
|
* Set up the claims in this object from the serialized form. This clears all current claims from the object.
|
||||||
// This doesn't handle loading JsonNull values from the claims set, and this is endemic to the whole claims structure!!!!
|
* @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) {
|
||||||
* Load this IdToken from a JSON Object
|
JsonParser parser = new JsonParser();
|
||||||
*/
|
JsonElement json = parser.parse(s);
|
||||||
@Override
|
if (json != null && json.isJsonObject()) {
|
||||||
public void loadFromJsonObject(JsonObject json) {
|
loadFromJsonObject(json.getAsJsonObject());
|
||||||
JsonObject pass = new JsonObject();
|
} else {
|
||||||
|
throw new IllegalArgumentException("Could not parse: " + s);
|
||||||
for (Entry<String, JsonElement> element : json.entrySet()) {
|
}
|
||||||
if (element.getValue().isJsonNull()) {
|
}
|
||||||
pass.add(element.getKey(), element.getValue());
|
|
||||||
} else if (element.getKey().equals(USER_ID)) {
|
//
|
||||||
setUserId(element.getValue().getAsString());
|
// FIXME:
|
||||||
} else if (element.getKey().equals(AUTHENTICATION_CONTEXT_CLASS_REFERENCE)) {
|
// This doesn't handle loading JsonNull values from the claims set, and this is endemic to the whole claims structure!!!!
|
||||||
setAuthContext(element.getValue().getAsString());
|
//
|
||||||
} else if (element.getKey().equals(NONCE)) {
|
|
||||||
setNonce(element.getValue().getAsString());
|
/**
|
||||||
} else if (element.getKey().equals(AUTH_TIME)) {
|
* Load this IdToken from a JSON Object
|
||||||
setAuthTime(new Date(element.getValue().getAsLong() * 1000L));
|
*/
|
||||||
} else {
|
@Override
|
||||||
pass.add(element.getKey(), element.getValue());
|
public void loadFromJsonObject(JsonObject json) {
|
||||||
}
|
JsonObject pass = new JsonObject();
|
||||||
}
|
|
||||||
|
for (Entry<String, JsonElement> element : json.entrySet()) {
|
||||||
super.loadFromJsonObject(pass);
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,295 +1,310 @@
|
||||||
package org.mitre.openid.connect.model;
|
/*******************************************************************************
|
||||||
|
* Copyright 2012 The MITRE Corporation
|
||||||
import javax.persistence.Basic;
|
*
|
||||||
import javax.persistence.Entity;
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
import javax.persistence.Id;
|
* you may not use this file except in compliance with the License.
|
||||||
import javax.persistence.JoinColumn;
|
* You may obtain a copy of the License at
|
||||||
import javax.persistence.NamedQueries;
|
*
|
||||||
import javax.persistence.NamedQuery;
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
import javax.persistence.OneToOne;
|
*
|
||||||
import javax.persistence.Table;
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
import com.google.gson.JsonObject;
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
@Entity
|
* limitations under the License.
|
||||||
@Table(name="userinfo")
|
******************************************************************************/
|
||||||
@NamedQueries({
|
package org.mitre.openid.connect.model;
|
||||||
@NamedQuery(name="UserInfo.getAll", query = "select u from UserInfo u")
|
|
||||||
})
|
import javax.persistence.Basic;
|
||||||
public class UserInfo {
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.Id;
|
||||||
private String userId;
|
import javax.persistence.JoinColumn;
|
||||||
private String name;
|
import javax.persistence.NamedQueries;
|
||||||
private String givenName;
|
import javax.persistence.NamedQuery;
|
||||||
private String familyName;
|
import javax.persistence.OneToOne;
|
||||||
private String middleName;
|
import javax.persistence.Table;
|
||||||
private String nickname;
|
|
||||||
private String profile;
|
import com.google.gson.JsonObject;
|
||||||
private String picture;
|
|
||||||
private String website;
|
@Entity
|
||||||
private String email;
|
@Table(name="userinfo")
|
||||||
private Boolean verified;
|
@NamedQueries({
|
||||||
private String gender;
|
@NamedQuery(name="UserInfo.getAll", query = "select u from UserInfo u")
|
||||||
private String zoneinfo;
|
})
|
||||||
private String locale;
|
public class UserInfo {
|
||||||
private String phoneNumber;
|
|
||||||
private Address address;
|
private String userId;
|
||||||
private String updatedTime;
|
private String name;
|
||||||
|
private String givenName;
|
||||||
|
private String familyName;
|
||||||
public JsonObject toJson() {
|
private String middleName;
|
||||||
JsonObject obj = new JsonObject();
|
private String nickname;
|
||||||
|
private String profile;
|
||||||
obj.addProperty("user_id", getUserId());
|
private String picture;
|
||||||
obj.addProperty("name", getName());
|
private String website;
|
||||||
obj.addProperty("given_name", getGivenName());
|
private String email;
|
||||||
obj.addProperty("family_name", getFamilyName());
|
private Boolean verified;
|
||||||
obj.addProperty("middle_name", getMiddleName());
|
private String gender;
|
||||||
obj.addProperty("nickname", getNickname());
|
private String zoneinfo;
|
||||||
obj.addProperty("profile", getProfile());
|
private String locale;
|
||||||
obj.addProperty("picture", getPicture());
|
private String phoneNumber;
|
||||||
obj.addProperty("website", getWebsite());
|
private Address address;
|
||||||
obj.addProperty("verified", getVerified());
|
private String updatedTime;
|
||||||
obj.addProperty("gender", getGender());
|
|
||||||
obj.addProperty("zone_info", getZoneinfo());
|
|
||||||
obj.addProperty("locale", getLocale());
|
public JsonObject toJson() {
|
||||||
obj.addProperty("phone_number", getPhoneNumber());
|
JsonObject obj = new JsonObject();
|
||||||
obj.addProperty("updated_time", getUpdatedTime());
|
|
||||||
|
obj.addProperty("user_id", getUserId());
|
||||||
JsonObject addr = new JsonObject();
|
obj.addProperty("name", getName());
|
||||||
addr.addProperty("formatted", getAddress().getFormatted());
|
obj.addProperty("given_name", getGivenName());
|
||||||
addr.addProperty("street_address", getAddress().getStreetAddress());
|
obj.addProperty("family_name", getFamilyName());
|
||||||
addr.addProperty("locality", getAddress().getLocality());
|
obj.addProperty("middle_name", getMiddleName());
|
||||||
addr.addProperty("region", getAddress().getRegion());
|
obj.addProperty("nickname", getNickname());
|
||||||
addr.addProperty("postal_code", getAddress().getPostalCode());
|
obj.addProperty("profile", getProfile());
|
||||||
addr.addProperty("country", getAddress().getCountry());
|
obj.addProperty("picture", getPicture());
|
||||||
|
obj.addProperty("website", getWebsite());
|
||||||
obj.add("address", addr);
|
obj.addProperty("verified", getVerified());
|
||||||
|
obj.addProperty("gender", getGender());
|
||||||
return obj;
|
obj.addProperty("zone_info", getZoneinfo());
|
||||||
}
|
obj.addProperty("locale", getLocale());
|
||||||
|
obj.addProperty("phone_number", getPhoneNumber());
|
||||||
/**
|
obj.addProperty("updated_time", getUpdatedTime());
|
||||||
* @return the userId
|
|
||||||
*/
|
JsonObject addr = new JsonObject();
|
||||||
@Id
|
addr.addProperty("formatted", getAddress().getFormatted());
|
||||||
public String getUserId() {
|
addr.addProperty("street_address", getAddress().getStreetAddress());
|
||||||
return userId;
|
addr.addProperty("locality", getAddress().getLocality());
|
||||||
}
|
addr.addProperty("region", getAddress().getRegion());
|
||||||
/**
|
addr.addProperty("postal_code", getAddress().getPostalCode());
|
||||||
* @param userId the userId to set
|
addr.addProperty("country", getAddress().getCountry());
|
||||||
*/
|
|
||||||
public void setUserId(String userId) {
|
obj.add("address", addr);
|
||||||
this.userId = userId;
|
|
||||||
}
|
return obj;
|
||||||
/**
|
}
|
||||||
* @return the name
|
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the userId
|
||||||
public String getName() {
|
*/
|
||||||
return name;
|
@Id
|
||||||
}
|
public String getUserId() {
|
||||||
/**
|
return userId;
|
||||||
* @param name the name to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setName(String name) {
|
* @param userId the userId to set
|
||||||
this.name = name;
|
*/
|
||||||
}
|
public void setUserId(String userId) {
|
||||||
/**
|
this.userId = userId;
|
||||||
* @return the givenName
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the name
|
||||||
public String getGivenName() {
|
*/
|
||||||
return givenName;
|
@Basic
|
||||||
}
|
public String getName() {
|
||||||
/**
|
return name;
|
||||||
* @param givenName the givenName to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setGivenName(String givenName) {
|
* @param name the name to set
|
||||||
this.givenName = givenName;
|
*/
|
||||||
}
|
public void setName(String name) {
|
||||||
/**
|
this.name = name;
|
||||||
* @return the familyName
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the givenName
|
||||||
public String getFamilyName() {
|
*/
|
||||||
return familyName;
|
@Basic
|
||||||
}
|
public String getGivenName() {
|
||||||
/**
|
return givenName;
|
||||||
* @param familyName the familyName to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setFamilyName(String familyName) {
|
* @param givenName the givenName to set
|
||||||
this.familyName = familyName;
|
*/
|
||||||
}
|
public void setGivenName(String givenName) {
|
||||||
/**
|
this.givenName = givenName;
|
||||||
* @return the middleName
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the familyName
|
||||||
public String getMiddleName() {
|
*/
|
||||||
return middleName;
|
@Basic
|
||||||
}
|
public String getFamilyName() {
|
||||||
/**
|
return familyName;
|
||||||
* @param middleName the middleName to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setMiddleName(String middleName) {
|
* @param familyName the familyName to set
|
||||||
this.middleName = middleName;
|
*/
|
||||||
}
|
public void setFamilyName(String familyName) {
|
||||||
/**
|
this.familyName = familyName;
|
||||||
* @return the nickname
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the middleName
|
||||||
public String getNickname() {
|
*/
|
||||||
return nickname;
|
@Basic
|
||||||
}
|
public String getMiddleName() {
|
||||||
/**
|
return middleName;
|
||||||
* @param nickname the nickname to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setNickname(String nickname) {
|
* @param middleName the middleName to set
|
||||||
this.nickname = nickname;
|
*/
|
||||||
}
|
public void setMiddleName(String middleName) {
|
||||||
/**
|
this.middleName = middleName;
|
||||||
* @return the profile
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the nickname
|
||||||
public String getProfile() {
|
*/
|
||||||
return profile;
|
@Basic
|
||||||
}
|
public String getNickname() {
|
||||||
/**
|
return nickname;
|
||||||
* @param profile the profile to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setProfile(String profile) {
|
* @param nickname the nickname to set
|
||||||
this.profile = profile;
|
*/
|
||||||
}
|
public void setNickname(String nickname) {
|
||||||
/**
|
this.nickname = nickname;
|
||||||
* @return the picture
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the profile
|
||||||
public String getPicture() {
|
*/
|
||||||
return picture;
|
@Basic
|
||||||
}
|
public String getProfile() {
|
||||||
/**
|
return profile;
|
||||||
* @param picture the picture to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setPicture(String picture) {
|
* @param profile the profile to set
|
||||||
this.picture = picture;
|
*/
|
||||||
}
|
public void setProfile(String profile) {
|
||||||
/**
|
this.profile = profile;
|
||||||
* @return the website
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the picture
|
||||||
public String getWebsite() {
|
*/
|
||||||
return website;
|
@Basic
|
||||||
}
|
public String getPicture() {
|
||||||
/**
|
return picture;
|
||||||
* @param website the website to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setWebsite(String website) {
|
* @param picture the picture to set
|
||||||
this.website = website;
|
*/
|
||||||
}
|
public void setPicture(String picture) {
|
||||||
/**
|
this.picture = picture;
|
||||||
* @return the email
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the website
|
||||||
public String getEmail() {
|
*/
|
||||||
return email;
|
@Basic
|
||||||
}
|
public String getWebsite() {
|
||||||
/**
|
return website;
|
||||||
* @param email the email to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setEmail(String email) {
|
* @param website the website to set
|
||||||
this.email = email;
|
*/
|
||||||
}
|
public void setWebsite(String website) {
|
||||||
/**
|
this.website = website;
|
||||||
* @return the verified
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the email
|
||||||
public Boolean getVerified() {
|
*/
|
||||||
return verified;
|
@Basic
|
||||||
}
|
public String getEmail() {
|
||||||
/**
|
return email;
|
||||||
* @param verified the verified to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setVerified(Boolean verified) {
|
* @param email the email to set
|
||||||
this.verified = verified;
|
*/
|
||||||
}
|
public void setEmail(String email) {
|
||||||
/**
|
this.email = email;
|
||||||
* @return the gender
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the verified
|
||||||
public String getGender() {
|
*/
|
||||||
return gender;
|
@Basic
|
||||||
}
|
public Boolean getVerified() {
|
||||||
/**
|
return verified;
|
||||||
* @param gender the gender to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setGender(String gender) {
|
* @param verified the verified to set
|
||||||
this.gender = gender;
|
*/
|
||||||
}
|
public void setVerified(Boolean verified) {
|
||||||
/**
|
this.verified = verified;
|
||||||
* @return the zoneinfo
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the gender
|
||||||
public String getZoneinfo() {
|
*/
|
||||||
return zoneinfo;
|
@Basic
|
||||||
}
|
public String getGender() {
|
||||||
/**
|
return gender;
|
||||||
* @param zoneinfo the zoneinfo to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setZoneinfo(String zoneinfo) {
|
* @param gender the gender to set
|
||||||
this.zoneinfo = zoneinfo;
|
*/
|
||||||
}
|
public void setGender(String gender) {
|
||||||
/**
|
this.gender = gender;
|
||||||
* @return the locale
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the zoneinfo
|
||||||
public String getLocale() {
|
*/
|
||||||
return locale;
|
@Basic
|
||||||
}
|
public String getZoneinfo() {
|
||||||
/**
|
return zoneinfo;
|
||||||
* @param locale the locale to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setLocale(String locale) {
|
* @param zoneinfo the zoneinfo to set
|
||||||
this.locale = locale;
|
*/
|
||||||
}
|
public void setZoneinfo(String zoneinfo) {
|
||||||
/**
|
this.zoneinfo = zoneinfo;
|
||||||
* @return the phoneNumber
|
}
|
||||||
*/
|
/**
|
||||||
@Basic
|
* @return the locale
|
||||||
public String getPhoneNumber() {
|
*/
|
||||||
return phoneNumber;
|
@Basic
|
||||||
}
|
public String getLocale() {
|
||||||
/**
|
return locale;
|
||||||
* @param phoneNumber the phoneNumber to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setPhoneNumber(String phoneNumber) {
|
* @param locale the locale to set
|
||||||
this.phoneNumber = phoneNumber;
|
*/
|
||||||
}
|
public void setLocale(String locale) {
|
||||||
/**
|
this.locale = locale;
|
||||||
* @return the address
|
}
|
||||||
*/
|
/**
|
||||||
@OneToOne
|
* @return the phoneNumber
|
||||||
@JoinColumn(name="address_id")
|
*/
|
||||||
public Address getAddress() {
|
@Basic
|
||||||
return address;
|
public String getPhoneNumber() {
|
||||||
}
|
return phoneNumber;
|
||||||
/**
|
}
|
||||||
* @param address the address to set
|
/**
|
||||||
*/
|
* @param phoneNumber the phoneNumber to set
|
||||||
public void setAddress(Address address) {
|
*/
|
||||||
this.address = address;
|
public void setPhoneNumber(String phoneNumber) {
|
||||||
}
|
this.phoneNumber = phoneNumber;
|
||||||
/**
|
}
|
||||||
* @return the updatedTime
|
/**
|
||||||
*/
|
* @return the address
|
||||||
@Basic
|
*/
|
||||||
public String getUpdatedTime() {
|
@OneToOne
|
||||||
return updatedTime;
|
@JoinColumn(name="address_id")
|
||||||
}
|
public Address getAddress() {
|
||||||
/**
|
return address;
|
||||||
* @param updatedTime the updatedTime to set
|
}
|
||||||
*/
|
/**
|
||||||
public void setUpdatedTime(String updatedTime) {
|
* @param address the address to set
|
||||||
this.updatedTime = updatedTime;
|
*/
|
||||||
}
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.model;
|
||||||
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.Address;
|
import org.mitre.openid.connect.model.Address;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.IdTokenClaims;
|
import org.mitre.openid.connect.model.IdTokenClaims;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.IdToken;
|
import org.mitre.openid.connect.model.IdToken;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.Address;
|
import org.mitre.openid.connect.model.Address;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.IdTokenClaims;
|
import org.mitre.openid.connect.model.IdTokenClaims;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.IdToken;
|
import org.mitre.openid.connect.model.IdToken;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.UserInfo;
|
import org.mitre.openid.connect.model.UserInfo;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.WhitelistedSite;
|
import org.mitre.openid.connect.model.WhitelistedSite;
|
||||||
|
|
|
@ -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;
|
package org.mitre.util;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
|
@ -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;
|
package org.mitre.util.jpa;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -1,50 +1,65 @@
|
||||||
package org.mitre.oauth2.exception;
|
/*******************************************************************************
|
||||||
/**
|
* 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
|
||||||
/**
|
*
|
||||||
* @author aanganes
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
*/
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
public class ClientNotFoundException extends RuntimeException {
|
* 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.
|
||||||
*/
|
******************************************************************************/
|
||||||
private static final Long serialVersionUID = 1L;
|
package org.mitre.oauth2.exception;
|
||||||
|
/**
|
||||||
/**
|
*
|
||||||
*
|
*/
|
||||||
*/
|
|
||||||
public ClientNotFoundException() {
|
|
||||||
// TODO Auto-generated constructor stub
|
/**
|
||||||
}
|
* @author aanganes
|
||||||
|
*
|
||||||
/**
|
*/
|
||||||
* @param message
|
public class ClientNotFoundException extends RuntimeException {
|
||||||
*/
|
|
||||||
public ClientNotFoundException(String message) {
|
/**
|
||||||
super(message);
|
*
|
||||||
// TODO Auto-generated constructor stub
|
*/
|
||||||
}
|
private static final Long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param cause
|
*
|
||||||
*/
|
*/
|
||||||
public ClientNotFoundException(Throwable cause) {
|
public ClientNotFoundException() {
|
||||||
super(cause);
|
// TODO Auto-generated constructor stub
|
||||||
// TODO Auto-generated constructor stub
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
/**
|
* @param message
|
||||||
* @param message
|
*/
|
||||||
* @param cause
|
public ClientNotFoundException(String message) {
|
||||||
*/
|
super(message);
|
||||||
public ClientNotFoundException(String message, Throwable cause) {
|
// TODO Auto-generated constructor stub
|
||||||
super(message, cause);
|
}
|
||||||
// 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
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.exception;
|
||||||
|
|
||||||
public class DuplicateClientIdException extends RuntimeException {
|
public class DuplicateClientIdException extends RuntimeException {
|
||||||
|
|
|
@ -1,49 +1,64 @@
|
||||||
/**
|
/*******************************************************************************
|
||||||
*
|
* Copyright 2012 The MITRE Corporation
|
||||||
*/
|
*
|
||||||
package org.mitre.oauth2.exception;
|
* 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
|
||||||
* @author AANGANES
|
*
|
||||||
*
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*/
|
*
|
||||||
public class PermissionDeniedException extends RuntimeException {
|
* 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.
|
||||||
private static final Long serialVersionUID = 1L;
|
******************************************************************************/
|
||||||
|
/**
|
||||||
/**
|
*
|
||||||
*
|
*/
|
||||||
*/
|
package org.mitre.oauth2.exception;
|
||||||
public PermissionDeniedException() {
|
|
||||||
// TODO Auto-generated constructor stub
|
/**
|
||||||
}
|
* @author AANGANES
|
||||||
|
*
|
||||||
/**
|
*/
|
||||||
* @param message
|
public class PermissionDeniedException extends RuntimeException {
|
||||||
*/
|
|
||||||
public PermissionDeniedException(String message) {
|
/**
|
||||||
super(message);
|
*
|
||||||
// TODO Auto-generated constructor stub
|
*/
|
||||||
}
|
private static final Long serialVersionUID = 1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param cause
|
*
|
||||||
*/
|
*/
|
||||||
public PermissionDeniedException(Throwable cause) {
|
public PermissionDeniedException() {
|
||||||
super(cause);
|
// TODO Auto-generated constructor stub
|
||||||
// TODO Auto-generated constructor stub
|
}
|
||||||
}
|
|
||||||
|
/**
|
||||||
/**
|
* @param message
|
||||||
* @param message
|
*/
|
||||||
* @param cause
|
public PermissionDeniedException(String message) {
|
||||||
*/
|
super(message);
|
||||||
public PermissionDeniedException(String message, Throwable cause) {
|
// TODO Auto-generated constructor stub
|
||||||
super(message, cause);
|
}
|
||||||
// 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
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.repository.impl;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.repository.impl;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.service.impl;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -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.
|
||||||
|
******************************************************************************/
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.view;
|
||||||
|
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.view;
|
||||||
|
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.web;
|
||||||
|
|
||||||
import org.mitre.oauth2.model.OAuth2AccessTokenEntity;
|
import org.mitre.oauth2.model.OAuth2AccessTokenEntity;
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.web;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -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.
|
||||||
|
******************************************************************************/
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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.
|
||||||
|
******************************************************************************/
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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;
|
package org.mitre.oauth2.web;
|
||||||
|
|
||||||
import org.mitre.oauth2.exception.PermissionDeniedException;
|
import org.mitre.oauth2.exception.PermissionDeniedException;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.exception;
|
||||||
|
|
||||||
public class ExpiredTokenException extends RuntimeException {
|
public class ExpiredTokenException extends RuntimeException {
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.exception;
|
||||||
|
|
||||||
public class InvalidJwtIssuerException extends RuntimeException {
|
public class InvalidJwtIssuerException extends RuntimeException {
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.exception;
|
||||||
|
|
||||||
public class InvalidJwtSignatureException extends RuntimeException {
|
public class InvalidJwtSignatureException extends RuntimeException {
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository.impl;
|
||||||
|
|
||||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository.impl;
|
||||||
|
|
||||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository.impl;
|
||||||
|
|
||||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository.impl;
|
||||||
|
|
||||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository.impl;
|
||||||
|
|
||||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository.impl;
|
||||||
|
|
||||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository.impl;
|
||||||
|
|
||||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.repository.impl;
|
||||||
|
|
||||||
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
import static org.mitre.util.jpa.JpaUtil.saveOrUpdate;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service.impl;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.Address;
|
import org.mitre.openid.connect.model.Address;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service.impl;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service.impl;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service.impl;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.IdTokenClaims;
|
import org.mitre.openid.connect.model.IdTokenClaims;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service.impl;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.IdToken;
|
import org.mitre.openid.connect.model.IdToken;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service.impl;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.UserInfo;
|
import org.mitre.openid.connect.model.UserInfo;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.service.impl;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.WhitelistedSite;
|
import org.mitre.openid.connect.model.WhitelistedSite;
|
||||||
|
|
|
@ -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.
|
||||||
|
******************************************************************************/
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.token;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.token;
|
||||||
|
|
||||||
import org.mitre.openid.connect.model.IdToken;
|
import org.mitre.openid.connect.model.IdToken;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.token;
|
||||||
|
|
||||||
import org.springframework.security.core.Authentication;
|
import org.springframework.security.core.Authentication;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.view;
|
||||||
|
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.view;
|
||||||
|
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
|
|
|
@ -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.
|
||||||
|
******************************************************************************/
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.web;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.web;
|
||||||
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.web;
|
||||||
|
|
||||||
import java.security.PublicKey;
|
import java.security.PublicKey;
|
||||||
|
|
|
@ -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;
|
package org.mitre.openid.connect.web;
|
||||||
|
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
|
|
|
@ -1,69 +1,84 @@
|
||||||
package org.mitre.openid.connect.web;
|
/*******************************************************************************
|
||||||
|
* Copyright 2012 The MITRE Corporation
|
||||||
import org.mitre.oauth2.model.ClientDetailsEntity;
|
*
|
||||||
import org.mitre.oauth2.model.OAuth2AccessTokenEntity;
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
import org.mitre.oauth2.service.OAuth2TokenEntityService;
|
* you may not use this file except in compliance with the License.
|
||||||
import org.mitre.openid.connect.model.UserInfo;
|
* You may obtain a copy of the License at
|
||||||
import org.mitre.openid.connect.service.UserInfoService;
|
*
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
import org.springframework.stereotype.Controller;
|
*
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
import org.springframework.web.servlet.ModelAndView;
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
/**
|
******************************************************************************/
|
||||||
* OpenID Connect UserInfo endpoint, as specified in Standard sec 5 and Messages sec 2.4.
|
package org.mitre.openid.connect.web;
|
||||||
*
|
|
||||||
* @author AANGANES
|
import org.mitre.oauth2.model.ClientDetailsEntity;
|
||||||
*
|
import org.mitre.oauth2.model.OAuth2AccessTokenEntity;
|
||||||
*/
|
import org.mitre.oauth2.service.OAuth2TokenEntityService;
|
||||||
@Controller
|
import org.mitre.openid.connect.model.UserInfo;
|
||||||
public class UserInfoEndpoint {
|
import org.mitre.openid.connect.service.UserInfoService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@Autowired
|
import org.springframework.stereotype.Controller;
|
||||||
OAuth2TokenEntityService tokenService;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
@Autowired
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
UserInfoService userInfoService;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get information about the user as specified in the accessToken->idToken included in this request
|
* OpenID Connect UserInfo endpoint, as specified in Standard sec 5 and Messages sec 2.4.
|
||||||
*
|
*
|
||||||
* @param accessToken the Access Token associated with this request
|
* @author AANGANES
|
||||||
* @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
|
@Controller
|
||||||
*/
|
public class UserInfoEndpoint {
|
||||||
@RequestMapping(value="/userinfo", method= {RequestMethod.GET, RequestMethod.POST})
|
|
||||||
public ModelAndView getInfo(@RequestParam("access_token") String accessToken, @RequestParam("schema") String schema, ModelAndView mav) {
|
@Autowired
|
||||||
|
OAuth2TokenEntityService tokenService;
|
||||||
//This will throw the proper error if the token cannot be found
|
|
||||||
OAuth2AccessTokenEntity token = tokenService.getAccessToken(accessToken);
|
@Autowired
|
||||||
|
UserInfoService userInfoService;
|
||||||
if (schema != "openid") {
|
|
||||||
//openid is the ONLY defined schema and is a required parameter
|
/**
|
||||||
//Will we be defining other schemas?
|
* Get information about the user as specified in the accessToken->idToken included in this request
|
||||||
//if schema is unrecognized, throw an error?
|
*
|
||||||
|
* @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
|
||||||
String userId = token.getIdToken().getTokenClaims().getUserId();
|
* @return JSON or JWT response containing UserInfo data
|
||||||
|
*/
|
||||||
UserInfo userInfo = userInfoService.getByUserId(userId);
|
@RequestMapping(value="/userinfo", method= {RequestMethod.GET, RequestMethod.POST})
|
||||||
|
public ModelAndView getInfo(@RequestParam("access_token") String accessToken, @RequestParam("schema") String schema, ModelAndView mav) {
|
||||||
ClientDetailsEntity client = token.getClient();
|
|
||||||
|
//This will throw the proper error if the token cannot be found
|
||||||
//if client wants plain JSON, give it JSON; if it wants a JWT, give it a JWT
|
OAuth2AccessTokenEntity token = tokenService.getAccessToken(accessToken);
|
||||||
|
|
||||||
//If returning JSON
|
if (schema != "openid") {
|
||||||
return new ModelAndView("jsonUserInfoView", "userInfo", userInfo);
|
//openid is the ONLY defined schema and is a required parameter
|
||||||
|
//Will we be defining other schemas?
|
||||||
// If returning JWT
|
//if schema is unrecognized, throw an error?
|
||||||
//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;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -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;
|
package org.mitre.swd.view;
|
||||||
|
|
||||||
import java.io.Writer;
|
import java.io.Writer;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue