diff --git a/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntity.java b/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntity.java index 0acd4f704..128dd3f46 100644 --- a/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntity.java +++ b/openid-connect-common/src/main/java/org/mitre/oauth2/model/ClientDetailsEntity.java @@ -18,6 +18,7 @@ */ package org.mitre.oauth2.model; +import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -118,7 +119,7 @@ public class ClientDetailsEntity implements ClientDetails { private boolean dynamicallyRegistered = false; // was this client dynamically registered? private boolean allowIntrospection = false; // do we let this client call the introspection endpoint? private Integer idTokenValiditySeconds; //timeout for id tokens - + private Date createdAt; // time the client was created public enum AuthMethod { SECRET_POST("client_secret_post"), @@ -850,4 +851,18 @@ public class ClientDetailsEntity implements ClientDetails { this.requestUris = requestUris; } + /** + * @return the createdAt + */ + public Date getCreatedAt() { + return createdAt; + } + + /** + * @param createdAt the createdAt to set + */ + public void setCreatedAt(Date createdAt) { + this.createdAt = createdAt; + } + } diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/ConnectAuthorizationRequestManager.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/ConnectAuthorizationRequestManager.java index 3baa5b50e..a9a4d426f 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/ConnectAuthorizationRequestManager.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/ConnectAuthorizationRequestManager.java @@ -170,12 +170,12 @@ public class ConnectAuthorizationRequestManager implements AuthorizationRequestM ClientDetailsEntity client = clientDetailsService.loadClientByClientId(clientId); - if (client.getJwkUrl() == null) { + if (client.getJwksUri() == null) { throw new InvalidClientException("Client must have a JWK URI registered to use request objects."); } // check JWT signature - JwtSigningAndValidationService validator = validators.get(client.getJwkUrl()); + JwtSigningAndValidationService validator = validators.get(client.getJwksUri()); if (validator == null) { throw new InvalidClientException("Client must have a JWK URI registered to use request objects."); } diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/assertion/JwtBearerAuthenticationProvider.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/assertion/JwtBearerAuthenticationProvider.java index cfc07c53a..fa9adc2a1 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/assertion/JwtBearerAuthenticationProvider.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/assertion/JwtBearerAuthenticationProvider.java @@ -66,7 +66,7 @@ public class JwtBearerAuthenticationProvider implements AuthenticationProvider { // check the signature with nimbus if (jwt instanceof SignedJWT) { SignedJWT jws = (SignedJWT)jwt; - JwtSigningAndValidationService validator = validators.get(client.getJwkUrl()); + JwtSigningAndValidationService validator = validators.get(client.getJwksUri()); if (validator == null || !validator.validateSignature(jws)) { throw new AuthenticationServiceException("Invalid signature"); } diff --git a/openid-connect-server/src/main/resources/db/tables/hsql_database_tables.sql b/openid-connect-server/src/main/resources/db/tables/hsql_database_tables.sql index fdd328ab8..d34183f3e 100644 --- a/openid-connect-server/src/main/resources/db/tables/hsql_database_tables.sql +++ b/openid-connect-server/src/main/resources/db/tables/hsql_database_tables.sql @@ -109,15 +109,27 @@ CREATE TABLE IF NOT EXISTS client_details ( default_max_age BIGINT, require_auth_time BOOLEAN NOT NULL DEFAULT FALSE, - default_acr VARCHAR(256) + created_at TIMESTAMP, + initiate_login_uri VARCHAR(2048), + post_logout_redirect_uri VARCHAR(2048) +); + +CREATE TABLE IF NOT EXISTS client_request_uri ( + owner_id BIGINT, + request_uri VARCHAR(2000) +); + +CREATE TABLE IF NOT EXISTS client_default_acr_value ( + owner_id BIGINT, + default_acr_value VARCHAR(2000) ); CREATE TABLE IF NOT EXISTS client_nonce ( id BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) PRIMARY KEY, value VARCHAR(256), client_id VARCHAR(256), - use_date DATE, - expire_date DATE + use_date TIMESTAMP, + expire_date TIMESTAMP ); CREATE TABLE IF NOT EXISTS client_contact ( diff --git a/openid-connect-server/src/main/resources/db/tables/mysql_database_tables.sql b/openid-connect-server/src/main/resources/db/tables/mysql_database_tables.sql index c7a957185..8c797645c 100644 --- a/openid-connect-server/src/main/resources/db/tables/mysql_database_tables.sql +++ b/openid-connect-server/src/main/resources/db/tables/mysql_database_tables.sql @@ -109,15 +109,27 @@ CREATE TABLE IF NOT EXISTS client_details ( default_max_age BIGINT, require_auth_time BOOLEAN NOT NULL DEFAULT 0, - default_acr VARCHAR(256) + created_at TIMESTAMP NULL, + initiate_login_uri VARCHAR(2048), + post_logout_redirect_uri VARCHAR(2048) +); + +CREATE TABLE IF NOT EXISTS client_request_uri ( + owner_id BIGINT, + request_uri VARCHAR(2000) +); + +CREATE TABLE IF NOT EXISTS client_default_acr_value ( + owner_id BIGINT, + default_acr_value VARCHAR(2000) ); CREATE TABLE IF NOT EXISTS client_nonce ( id BIGINT AUTO_INCREMENT PRIMARY KEY, value VARCHAR(256), client_id VARCHAR(256), - use_date DATE, - expire_date DATE + use_date TIMESTAMP NULL, + expire_date TIMESTAMP NULL ); CREATE TABLE IF NOT EXISTS client_contact (