diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..a9ae158608
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,14 @@
+# EditorConfig is awesome: http://EditorConfig.org
+
+# top-most EditorConfig file
+root = true
+
+# Unix-style newlines with a newline ending every file
+[*]
+end_of_line = lf
+insert_final_newline = true
+
+# 4 space - Tab indentation
+[*.{java,xml,js,html}]
+indent_style = tab
+indent_size = 4
diff --git a/.gitignore b/.gitignore
index cc7301fd52..e663c16b8f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
-local-values.conf
target
*~
bin
diff --git a/.travis.yml b/.travis.yml
index 3be2ae5cdf..3d619c8263 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,6 +1,11 @@
language: java
jdk:
- - oraclejdk8
- - oraclejdk7
- - openjdk7
+ - oraclejdk11
sudo: false
+
+after_success:
+ - bash <(curl -s https://codecov.io/bash)
+
+cache:
+ directories:
+ - $HOME/.m2
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000000..96c6356a0c
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,43 @@
+Unreleased:
+
+*1.3.3*:
+- Authorization codes are now longer
+- Client/RS can parse the "sub" and "user_id" claims in introspection response
+- Database-direct queries for fetching tokens by user (optimization)
+- Device flow supports verification_uri_complete (must be turned on)
+- Long scopes display properly and are still checkable
+- Language system remebers when it can't find a file and stops throwing so many errors
+- Index added for refresh tokens
+- Updated to Spring Security 4.2.11
+- Updated Spring to 4.3.22
+- Change approve pages to use issuer instead of page context
+- Updated oracle database scripts
+
+*1.3.2*:
+- Added changelog
+- Set default redirect URI resolver strict matching to true
+- Fixed XSS vulnerability on redirect URI display on approval page
+- Removed MITRE from copyright
+- Disallow unsigned JWTs on client authentication
+- Upgraded Nimbus revision
+- Added French translation
+- Added hooks for custom JWT claims
+- Removed "Not Yet Implemented" tag from post-logout redirect URI
+
+*1.3.1*:
+- Added End Session endpoint
+- Fixed discovery endpoint
+- Downgrade MySQL connector dependency version from developer preview to GA release
+
+*1.3.0*:
+- Added device flow support
+- Added PKCE support
+- Modularized UI to allow better overlay and extensions
+- Modularized data import/export API
+- Added software statements to dynamic client registration
+- Added assertion processing framework
+- Removed ID tokens from storage
+- Removed structured scopes
+
+*1.2.6*:
+- Added strict HEART compliance mode
diff --git a/LICENSE.txt b/LICENSE.txt
index 093874f21f..0e640e493b 100644
--- a/LICENSE.txt
+++ b/LICENSE.txt
@@ -1,8 +1,9 @@
-Copyright 2016 The MITRE Corporation
- and the MIT Internet Trust Consortium
+Copyright 2018 The MIT Internet Trust Consortium
+
+Portions copyright 2011-2013 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 not use this project except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
diff --git a/README.md b/README.md
index a80728fd83..610579f550 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,7 @@
# MITREid Connect
---
-[](https://maven-badges.herokuapp.com/maven-central/org.mitre/openid-connect-parent) [](https://travis-ci.org/mitreid-connect/OpenID-Connect-Java-Spring-Server)
+[](https://maven-badges.herokuapp.com/maven-central/org.mitre/openid-connect-parent) [](https://travis-ci.org/mitreid-connect/OpenID-Connect-Java-Spring-Server) [](https://codecov.io/github/mitreid-connect/OpenID-Connect-Java-Spring-Server)
This project contains a certified OpenID Connect reference implementation in Java on the Spring platform, including a functioning [server library](openid-connect-server), [deployable server package](openid-connect-server-webapp), [client (RP) library](openid-connect-client), and general [utility libraries](openid-connect-common). The server can be used as an OpenID Connect Identity Provider as well as a general-purpose OAuth 2.0 Authorization Server.
@@ -28,7 +28,4 @@ The authors and key contributors of the project include:
* [Mark Janssen](https://github.com/praseodym)
-
-
-Copyright ©2016, [The MITRE Corporation](http://www.mitre.org/)
- and the [MIT Internet Trust Consortium](http://www.mit-trust.org/). Licensed under the Apache 2.0 license, for details see `LICENSE.txt`.
+Licensed under the Apache 2.0 license, for details see `LICENSE.txt`.
diff --git a/README_zh_CN.md b/README_zh_CN.md
new file mode 100644
index 0000000000..4933b36836
--- /dev/null
+++ b/README_zh_CN.md
@@ -0,0 +1,38 @@
+# MITREid Connect
+---
+
+[](https://maven-badges.herokuapp.com/maven-central/org.mitre/openid-connect-parent) [](https://travis-ci.org/mitreid-connect/OpenID-Connect-Java-Spring-Server)
+
+此项目提供了一个业经认证的、用Java语言构筑于Spring平台之上的OpenID Connect参考实现,包括 [服务器端的实现库](openid-connect-server), [可部署的服务器包](openid-connect-server-webapp), [客户端 (RP) 的库](openid-connect-client), 以及 [工具类库](openid-connect-common)。该服务器可以用做OpenID Connect身份提供者,也可以用做一般意义上的OAuth 2.0授权服务器。
+
+[](https://openid.net/certification/)
+
+有关项目的更多信息参见:
+
+* [项目在GitHub上的主页 (及相关项目)](https://github.com/mitreid-connect/)
+* [完整的文档](https://github.com/mitreid-connect/OpenID-Connect-Java-Spring-Server/wiki)
+* [Maven文档及Java API](http://mitreid-connect.github.com/)
+* [问题(Issue)追踪系统 (用于报告bug及提交支持请求)](https://github.com/mitreid-connect/OpenID-Connect-Java-Spring-Server/issues)
+* 项目的邮件列表: `mitreid-connect@mit.edu`, 及其 [在线存档](https://mailman.mit.edu/mailman/listinfo/mitreid-connect).
+
+
+项目的作者及主要贡献者有:
+
+* [Justin Richer](https://github.com/jricher/)
+* [Amanda Anganes](https://github.com/aanganes/)
+* [Michael Jett](https://github.com/jumbojett/)
+* [Michael Walsh](https://github.com/nemonik/)
+* [Steve Moore](https://github.com/srmoore)
+* [Mike Derryberry](https://github.com/mtderryberry)
+* [William Kim](https://github.com/wikkim)
+* [Mark Janssen](https://github.com/praseodym)
+
+
+项目的中文译者:
+
+* [刘晓曦](https://github.com/liouxiao/)
+
+
+
+
+版权所有 ©2018 [MIT因特网信任联盟](http://www.mit-trust.org/). 采用Apache 2.0许可证, 详见 `LICENSE.txt`.
diff --git a/checkstyle.xml b/checkstyle.xml
index f95d9e3b0e..06129daddb 100644
--- a/checkstyle.xml
+++ b/checkstyle.xml
@@ -1,7 +1,8 @@
+
+
+ OpenID Connect Server entities
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/openid-connect-server-webapp/src/main/resources/db/oracle/loading_temp_tables_oracle.sql b/openid-connect-server-webapp/src/main/resources/db/oracle/loading_temp_tables_oracle.sql
new file mode 100644
index 0000000000..c9a1e7f3d6
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/resources/db/oracle/loading_temp_tables_oracle.sql
@@ -0,0 +1,77 @@
+--
+-- Temporary tables used during the bootstrapping process to safely load users and clients.
+-- These are not needed if you're not using the users.sql/clients.sql files to bootstrap the database.
+--
+
+CREATE GLOBAL TEMPORARY TABLE authorities_TEMP (
+ username varchar2(50) not null,
+ authority varchar2(50) not null,
+ constraint ix_authority_TEMP unique (username,authority)
+) ON COMMIT PRESERVE ROWS;
+
+CREATE GLOBAL TEMPORARY TABLE users_TEMP (
+ username VARCHAR2(50) not null primary key,
+ password VARCHAR2(50) not null,
+ enabled NUMBER(1) not null
+) ON COMMIT PRESERVE ROWS;
+
+CREATE GLOBAL TEMPORARY TABLE user_info_TEMP (
+ sub VARCHAR2(256) not null primary key,
+ preferred_username VARCHAR2(256),
+ name VARCHAR2(256),
+ given_name VARCHAR2(256),
+ family_name VARCHAR2(256),
+ middle_name VARCHAR2(256),
+ nickname VARCHAR2(256),
+ profile VARCHAR2(256),
+ picture VARCHAR2(256),
+ website VARCHAR2(256),
+ email VARCHAR2(256),
+ email_verified NUMBER(1),
+ gender VARCHAR2(256),
+ zone_info VARCHAR2(256),
+ locale VARCHAR2(256),
+ phone_number VARCHAR2(256),
+ address_id VARCHAR2(256),
+ updated_time VARCHAR2(256),
+ birthdate VARCHAR2(256)
+) ON COMMIT PRESERVE ROWS;
+
+CREATE GLOBAL TEMPORARY TABLE client_details_TEMP (
+ client_description VARCHAR2(256),
+ dynamically_registered NUMBER(1),
+ id_token_validity_seconds NUMBER(19),
+
+ client_id VARCHAR2(256),
+ client_secret VARCHAR2(2048),
+ access_token_validity_seconds NUMBER(19),
+ refresh_token_validity_seconds NUMBER(19),
+ allow_introspection NUMBER(1),
+
+ client_name VARCHAR2(256)
+) ON COMMIT PRESERVE ROWS;
+
+CREATE GLOBAL TEMPORARY TABLE client_scope_TEMP (
+ owner_id VARCHAR2(256),
+ scope VARCHAR2(2048)
+) ON COMMIT PRESERVE ROWS;
+
+CREATE GLOBAL TEMPORARY TABLE client_redirect_uri_TEMP (
+ owner_id VARCHAR2(256),
+ redirect_uri VARCHAR2(2048)
+) ON COMMIT PRESERVE ROWS;
+
+CREATE GLOBAL TEMPORARY TABLE client_grant_type_TEMP (
+ owner_id VARCHAR2(256),
+ grant_type VARCHAR2(2000)
+) ON COMMIT PRESERVE ROWS;
+
+CREATE GLOBAL TEMPORARY TABLE system_scope_TEMP (
+ scope VARCHAR2(256),
+ description VARCHAR2(4000),
+ icon VARCHAR2(256),
+ restricted NUMBER(1),
+ default_scope NUMBER(1),
+ structured NUMBER(1),
+ structured_param_description VARCHAR2(256)
+) ON COMMIT PRESERVE ROWS;
diff --git a/openid-connect-server-webapp/src/main/resources/db/oracle/oracle_database_index.sql b/openid-connect-server-webapp/src/main/resources/db/oracle/oracle_database_index.sql
new file mode 100644
index 0000000000..fc70a7ae41
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/resources/db/oracle/oracle_database_index.sql
@@ -0,0 +1,18 @@
+--
+-- Indexes for Oracle
+--
+
+CREATE INDEX at_tv_idx ON access_token(token_value);
+CREATE INDEX ts_oi_idx ON token_scope(owner_id);
+CREATE INDEX at_exp_idx ON access_token(expiration);
+CREATE INDEX rf_ahi_idx ON refresh_token(auth_holder_id);
+CREATE INDEX rf_tv_idx ON refresh_token(token_value);
+CREATE INDEX at_ahi_idx ON access_token(auth_holder_id);
+CREATE INDEX aha_oi_idx ON authentication_holder_authority(owner_id);
+CREATE INDEX ahe_oi_idx ON authentication_holder_extension(owner_id);
+CREATE INDEX ahrp_oi_idx ON authentication_holder_request_parameter(owner_id);
+CREATE INDEX ahri_oi_idx ON authentication_holder_resource_id(owner_id);
+CREATE INDEX ahrt_oi_idx ON authentication_holder_response_type(owner_id);
+CREATE INDEX ahs_oi_idx ON authentication_holder_scope(owner_id);
+CREATE INDEX ac_ahi_idx ON authorization_code(auth_holder_id);
+CREATE INDEX suaa_oi_idx ON saved_user_auth_authority(owner_id);
diff --git a/openid-connect-server-webapp/src/main/resources/db/oracle/oracle_database_tables.sql b/openid-connect-server-webapp/src/main/resources/db/oracle/oracle_database_tables.sql
new file mode 100644
index 0000000000..9f430adace
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/resources/db/oracle/oracle_database_tables.sql
@@ -0,0 +1,417 @@
+--
+-- Tables for OIDC Server functionality, Oracle
+--
+
+CREATE TABLE access_token (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ token_value VARCHAR2(4000),
+ expiration TIMESTAMP,
+ token_type VARCHAR2(256),
+ refresh_token_id NUMBER(19),
+ client_id NUMBER(19),
+ auth_holder_id NUMBER(19),
+ approved_site_id NUMBER(19)
+);
+CREATE SEQUENCE access_token_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE access_token_permissions (
+ access_token_id NUMBER(19) NOT NULL,
+ permission_id NUMBER(19) NOT NULL
+);
+
+CREATE TABLE address (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ formatted VARCHAR2(256),
+ street_address VARCHAR2(256),
+ locality VARCHAR2(256),
+ region VARCHAR2(256),
+ postal_code VARCHAR2(256),
+ country VARCHAR2(256)
+);
+CREATE SEQUENCE address_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE approved_site (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ user_id VARCHAR2(256),
+ client_id VARCHAR2(256),
+ creation_date TIMESTAMP,
+ access_date TIMESTAMP,
+ timeout_date TIMESTAMP,
+ whitelisted_site_id NUMBER(19)
+);
+CREATE SEQUENCE approved_site_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE approved_site_scope (
+ owner_id NUMBER(19),
+ scope VARCHAR2(256)
+);
+
+CREATE TABLE authentication_holder (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ user_auth_id NUMBER(19),
+ approved NUMBER(1),
+ redirect_uri VARCHAR2(2048),
+ client_id VARCHAR2(256),
+
+ CONSTRAINT approved_check CHECK (approved in (1,0))
+);
+CREATE SEQUENCE authentication_holder_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE auth_holder_authority (
+ owner_id NUMBER(19),
+ authority VARCHAR2(256)
+);
+
+CREATE TABLE auth_holder_resource_id (
+ owner_id NUMBER(19),
+ resource_id VARCHAR2(2048)
+);
+
+CREATE TABLE auth_holder_response_type (
+ owner_id NUMBER(19),
+ response_type VARCHAR2(2048)
+);
+
+CREATE TABLE auth_holder_extension (
+ owner_id NUMBER(19),
+ extension VARCHAR2(2048),
+ val VARCHAR2(2048)
+);
+
+CREATE TABLE authentication_holder_scope (
+ owner_id NUMBER(19),
+ scope VARCHAR2(2048)
+);
+
+CREATE TABLE auth_holder_request_parameter (
+ owner_id NUMBER(19),
+ param VARCHAR2(2048),
+ val VARCHAR2(2048)
+);
+
+CREATE TABLE saved_user_auth (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ name VARCHAR2(1024),
+ authenticated NUMBER(1),
+ source_class VARCHAR2(2048),
+
+ CONSTRAINT authenticated_check CHECK (authenticated in (1,0))
+);
+CREATE SEQUENCE saved_user_auth_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE saved_user_auth_authority (
+ owner_id NUMBER(19),
+ authority VARCHAR2(256)
+);
+
+CREATE TABLE client_authority (
+ owner_id NUMBER(19),
+ authority VARCHAR2(256)
+);
+
+CREATE TABLE authorization_code (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ code VARCHAR2(256),
+ auth_holder_id NUMBER(19),
+ expiration TIMESTAMP
+);
+CREATE SEQUENCE authorization_code_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE client_grant_type (
+ owner_id NUMBER(19),
+ grant_type VARCHAR2(2000)
+);
+
+CREATE TABLE client_response_type (
+ owner_id NUMBER(19),
+ response_type VARCHAR2(2000)
+);
+
+CREATE TABLE blacklisted_site (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ uri VARCHAR2(2048)
+);
+CREATE SEQUENCE blacklisted_site_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE client_details (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+
+ client_description VARCHAR2(1024),
+ reuse_refresh_tokens NUMBER(1) DEFAULT 1 NOT NULL,
+ dynamically_registered NUMBER(1) DEFAULT 0 NOT NULL,
+ allow_introspection NUMBER(1) DEFAULT 0 NOT NULL,
+ id_token_validity_seconds NUMBER(19) DEFAULT 600 NOT NULL,
+
+ client_id VARCHAR2(256),
+ client_secret VARCHAR2(2048),
+ access_token_validity_seconds NUMBER(19),
+ refresh_token_validity_seconds NUMBER(19),
+ device_code_validity_seconds NUMBER(19),
+
+ application_type VARCHAR2(256),
+ client_name VARCHAR2(256),
+ token_endpoint_auth_method VARCHAR2(256),
+ subject_type VARCHAR2(256),
+
+ logo_uri VARCHAR2(2048),
+ policy_uri VARCHAR2(2048),
+ client_uri VARCHAR2(2048),
+ tos_uri VARCHAR2(2048),
+
+ jwks_uri VARCHAR2(2048),
+ jwks CLOB,
+ sector_identifier_uri VARCHAR2(2048),
+
+ request_object_signing_alg VARCHAR2(256),
+
+ user_info_signed_response_alg VARCHAR2(256),
+ user_info_encrypted_resp_alg VARCHAR2(256),
+ user_info_encrypted_resp_enc VARCHAR2(256),
+
+ id_token_signed_response_alg VARCHAR2(256),
+ id_token_encrypted_resp_alg VARCHAR2(256),
+ id_token_encrypted_resp_enc VARCHAR2(256),
+
+ token_endpoint_auth_sign_alg VARCHAR2(256),
+
+ default_max_age NUMBER(19),
+ require_auth_time NUMBER(1),
+ created_at TIMESTAMP,
+ initiate_login_uri VARCHAR2(2048),
+ clear_access_tokens_on_refresh NUMBER(1) DEFAULT 1 NOT NULL,
+
+ software_statement VARCHAR(4096),
+ software_id VARCHAR(2048),
+ software_statement VARCHAR2(4000),
+
+ code_challenge_method VARCHAR2(256),
+
+ CONSTRAINT client_details_unique UNIQUE (client_id),
+ CONSTRAINT reuse_refresh_tokens_check CHECK (reuse_refresh_tokens in (1,0)),
+ CONSTRAINT dynamically_registered_check CHECK (dynamically_registered in (1,0)),
+ CONSTRAINT allow_introspection_check CHECK (allow_introspection in (1,0)),
+ CONSTRAINT require_auth_time_check CHECK (require_auth_time in (1,0)),
+ CONSTRAINT clear_acc_tok_on_refresh_check CHECK (clear_access_tokens_on_refresh in (1,0))
+);
+CREATE SEQUENCE client_details_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE client_request_uri (
+ owner_id NUMBER(19),
+ request_uri VARCHAR2(2000)
+);
+
+CREATE TABLE client_post_logout_redir_uri (
+ owner_id NUMBER(19),
+ post_logout_redirect_uri VARCHAR2(2000)
+);
+
+CREATE TABLE client_default_acr_value (
+ owner_id NUMBER(19),
+ default_acr_value VARCHAR2(2000)
+);
+
+CREATE TABLE client_contact (
+ owner_id NUMBER(19),
+ contact VARCHAR2(256)
+);
+
+CREATE TABLE client_redirect_uri (
+ owner_id NUMBER(19),
+ redirect_uri VARCHAR2(2048)
+);
+
+CREATE TABLE client_claims_redirect_uri (
+ owner_id NUMBER(19),
+ redirect_uri VARCHAR2(2048)
+);
+
+CREATE TABLE refresh_token (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ token_value VARCHAR2(4000),
+ expiration TIMESTAMP,
+ auth_holder_id NUMBER(19),
+ client_id NUMBER(19)
+);
+CREATE SEQUENCE refresh_token_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE client_resource (
+ owner_id NUMBER(19),
+ resource_id VARCHAR2(256)
+);
+
+CREATE TABLE client_scope (
+ owner_id NUMBER(19),
+ scope VARCHAR2(2048)
+);
+
+CREATE TABLE token_scope (
+ owner_id NUMBER(19),
+ scope VARCHAR2(2048)
+);
+
+CREATE TABLE system_scope (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ scope VARCHAR2(256) NOT NULL,
+ description VARCHAR2(4000),
+ icon VARCHAR2(256),
+ restricted NUMBER(1) DEFAULT 0 NOT NULL,
+ default_scope NUMBER(1) DEFAULT 0 NOT NULL
+
+ CONSTRAINT system_scope_unique UNIQUE (scope),
+ CONSTRAINT default_scope_check CHECK (default_scope in (1,0)),
+ CONSTRAINT restricted_check CHECK (restricted in (1,0))
+);
+CREATE SEQUENCE system_scope_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE user_info (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ sub VARCHAR2(256),
+ preferred_username VARCHAR2(256),
+ name VARCHAR2(256),
+ given_name VARCHAR2(256),
+ family_name VARCHAR2(256),
+ middle_name VARCHAR2(256),
+ nickname VARCHAR2(256),
+ profile VARCHAR2(256),
+ picture VARCHAR2(256),
+ website VARCHAR2(256),
+ email VARCHAR2(256),
+ email_verified NUMBER(1),
+ gender VARCHAR2(256),
+ zone_info VARCHAR2(256),
+ locale VARCHAR2(256),
+ phone_number VARCHAR2(256),
+ phone_number_verified NUMBER(1),
+ address_id VARCHAR2(256),
+ updated_time VARCHAR2(256),
+ birthdate VARCHAR2(256),
+ src VARCHAR2(4000),
+
+ CONSTRAINT email_verified_check CHECK (email_verified in (1,0)),
+ CONSTRAINT phone_number_verified_check CHECK (phone_number_verified in (1,0))
+);
+CREATE SEQUENCE user_info_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE whitelisted_site (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ creator_user_id VARCHAR2(256),
+ client_id VARCHAR2(256)
+);
+CREATE SEQUENCE whitelisted_site_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE whitelisted_site_scope (
+ owner_id NUMBER(19),
+ scope VARCHAR2(256)
+);
+
+CREATE TABLE pairwise_identifier (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ identifier VARCHAR2(256),
+ sub VARCHAR2(256),
+ sector_identifier VARCHAR2(2048)
+);
+CREATE SEQUENCE pairwise_identifier_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE resource_set (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ name VARCHAR2(1024) NOT NULL,
+ uri VARCHAR2(1024),
+ icon_uri VARCHAR2(1024),
+ rs_type VARCHAR2(256),
+ owner VARCHAR2(256) NOT NULL,
+ client_id VARCHAR2(256)
+);
+CREATE SEQUENCE resource_set_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE resource_set_scope (
+ owner_id NUMBER(19) NOT NULL,
+ scope VARCHAR2(256) NOT NULL
+);
+
+CREATE TABLE permission_ticket (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ ticket VARCHAR2(256) NOT NULL,
+ permission_id NUMBER(19) NOT NULL,
+ expiration TIMESTAMP
+);
+CREATE SEQUENCE permission_ticket_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE permission (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ resource_set_id NUMBER(19)
+);
+CREATE SEQUENCE permission_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE permission_scope (
+ owner_id NUMBER(19) NOT NULL,
+ scope VARCHAR2(256) NOT NULL
+);
+
+CREATE TABLE claim (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ name VARCHAR2(256),
+ friendly_name VARCHAR2(1024),
+ claim_type VARCHAR2(1024),
+ claim_value VARCHAR2(1024)
+);
+CREATE SEQUENCE claim_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE claim_to_policy (
+ policy_id NUMBER(19) NOT NULL,
+ claim_id NUMBER(19) NOT NULL
+);
+
+CREATE TABLE claim_to_permission_ticket (
+ permission_ticket_id NUMBER(19) NOT NULL,
+ claim_id NUMBER(19) NOT NULL
+);
+
+CREATE TABLE policy (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ name VARCHAR2(1024),
+ resource_set_id NUMBER(19)
+);
+CREATE SEQUENCE policy_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE policy_scope (
+ owner_id NUMBER(19) NOT NULL,
+ scope VARCHAR2(256) NOT NULL
+);
+
+CREATE TABLE claim_token_format (
+ owner_id NUMBER(19) NOT NULL,
+ claim_token_format VARCHAR2(1024) NOT NULL
+);
+
+CREATE TABLE claim_issuer (
+ owner_id NUMBER(19) NOT NULL,
+ issuer VARCHAR2(1024) NOT NULL
+);
+
+CREATE TABLE saved_registered_client (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ issuer VARCHAR2(1024),
+ registered_client CLOB
+);
+CREATE SEQUENCE saved_registered_client_seq START WITH 1 INCREMENT BY 1 NOCACHE NOCYCLE;
+
+CREATE TABLE IF NOT EXISTS device_code (
+ id NUMBER(19) NOT NULL PRIMARY KEY,
+ device_code VARCHAR2(1024),
+ user_code VARCHAR2(1024),
+ expiration TIMESTAMP,
+ client_id VARCHAR2(256),
+ approved BOOLEAN,
+ auth_holder_id NUMBER(19)
+);
+
+CREATE TABLE IF NOT EXISTS device_code_scope (
+ owner_id NUMBER(19) NOT NULL,
+ scope VARCHAR2(256) NOT NULL
+);
+
+CREATE TABLE IF NOT EXISTS device_code_request_parameter (
+ owner_id NUMBER(19),
+ param VARCHAR2(2048),
+ val VARCHAR2(2048)
+);
diff --git a/openid-connect-server-webapp/src/main/resources/db/oracle/scopes_oracle.sql b/openid-connect-server-webapp/src/main/resources/db/oracle/scopes_oracle.sql
new file mode 100644
index 0000000000..bb6bc82a23
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/resources/db/oracle/scopes_oracle.sql
@@ -0,0 +1,26 @@
+--
+-- Insert scope information into the temporary tables.
+--
+
+INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
+ ('openid', 'log in using your identity', 'user', 0, 1);
+INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
+ ('profile', 'basic profile information', 'list-alt', 0, 1);
+INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
+ ('email', 'email address', 'envelope', 0, 1);
+INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
+ ('address', 'physical address', 'home', 0, 1);
+INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
+ ('phone', 'telephone number', 'bell', 0, 1, 0);
+INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
+ ('offline_access', 'offline access', 'time', 0, 0);
+--
+-- Merge the temporary scopes safely into the database. This is a two-step process to keep scopes from being created on every startup with a persistent store.
+--
+
+MERGE INTO system_scope
+ USING (SELECT scope, description, icon, restricted, default_scope FROM system_scope_TEMP) vals
+ ON (vals.scope = system_scope.scope)
+ WHEN NOT MATCHED THEN
+ INSERT (id, scope, description, icon, restricted, default_scope) VALUES(system_scope_seq.nextval, vals.scope,
+ vals.description, vals.icon, vals.restricted, vals.default_scope);
diff --git a/openid-connect-server-webapp/src/main/resources/db/oracle/security-schema_oracle.sql b/openid-connect-server-webapp/src/main/resources/db/oracle/security-schema_oracle.sql
new file mode 100644
index 0000000000..5b67ef668f
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/resources/db/oracle/security-schema_oracle.sql
@@ -0,0 +1,18 @@
+--
+-- Tables for Spring Security's user details service
+--
+
+create table users(
+ username varchar2(50) not null primary key,
+ password varchar2(50) not null,
+ enabled number(1) not null,
+
+ constraint enabled_check check (enabled in (1, 0))
+);
+
+create table authorities (
+ username varchar2(50) not null,
+ authority varchar2(50) not null,
+ constraint fk_authorities_users foreign key(username) references users(username),
+ constraint ix_authority unique (username,authority)
+);
diff --git a/openid-connect-server-webapp/src/main/resources/db/oracle/users_oracle.sql b/openid-connect-server-webapp/src/main/resources/db/oracle/users_oracle.sql
new file mode 100644
index 0000000000..732a13f16e
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/resources/db/oracle/users_oracle.sql
@@ -0,0 +1,39 @@
+--
+-- Insert user information into the temporary tables. To add users to the Oracle database, edit things here.
+--
+
+INSERT INTO users_TEMP (username, password, enabled) VALUES ('admin','password',1);
+INSERT INTO users_TEMP (username, password, enabled) VALUES ('user','password',1);
+
+
+INSERT INTO authorities_TEMP (username, authority) VALUES ('admin','ROLE_ADMIN');
+INSERT INTO authorities_TEMP (username, authority) VALUES('admin','ROLE_USER');
+INSERT INTO authorities_TEMP (username, authority) VALUES('user','ROLE_USER');
+
+-- By default, the username column here has to match the username column in the users table, above
+INSERT INTO user_info_TEMP (sub, preferred_username, name, email, email_verified) VALUES ('90342.ASDFJWFA','admin','Demo Admin','admin@example.com', 1);
+INSERT INTO user_info_TEMP (sub, preferred_username, name, email, email_verified) VALUES ('01921.FLANRJQW','user','Demo User','user@example.com', 1);
+
+
+--
+-- Merge the temporary users safely into the database. This is a two-step process to keep users from being created on every startup with a persistent store.
+--
+
+MERGE INTO users
+ USING (SELECT username, password, enabled FROM users_TEMP) vals
+ ON (vals.username = users.username)
+ WHEN NOT MATCHED THEN
+ INSERT (username, password, enabled) VALUES(vals.username, vals.password, vals.enabled);
+
+MERGE INTO authorities
+ USING (SELECT username, authority FROM authorities_TEMP) vals
+ ON (vals.username = authorities.username AND vals.authority = authorities.authority)
+ WHEN NOT MATCHED THEN
+ INSERT (username,authority) values (vals.username, vals.authority);
+
+MERGE INTO user_info
+ USING (SELECT sub, preferred_username, name, email, email_verified FROM user_info_TEMP) vals
+ ON (vals.preferred_username = user_info.preferred_username)
+ WHEN NOT MATCHED THEN
+ INSERT (id, sub, preferred_username, name, email, email_verified) VALUES (user_info_seq.nextval, vals.sub, vals.preferred_username, vals.name, vals.email,
+ vals.email_verified);
diff --git a/openid-connect-server-webapp/src/main/resources/db/psql/clients.sql b/openid-connect-server-webapp/src/main/resources/db/psql/clients.sql
new file mode 100644
index 0000000000..bf14c2b2b6
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/resources/db/psql/clients.sql
@@ -0,0 +1,66 @@
+--
+-- Turn off autocommit and start a transaction so that we can use the temp tables
+--
+
+--SET AUTOCOMMIT = OFF;
+
+START TRANSACTION;
+
+--
+-- Insert client information into the temporary tables. To add clients to the HSQL database, edit things here.
+--
+
+INSERT INTO client_details_TEMP (client_id, client_secret, client_name, dynamically_registered, refresh_token_validity_seconds, access_token_validity_seconds, id_token_validity_seconds, allow_introspection) VALUES
+ ('client', 'secret', 'Test Client', false, null, 3600, 600, true);
+
+INSERT INTO client_scope_TEMP (owner_id, scope) VALUES
+ ('client', 'openid'),
+ ('client', 'profile'),
+ ('client', 'email'),
+ ('client', 'address'),
+ ('client', 'phone'),
+ ('client', 'offline_access');
+
+INSERT INTO client_redirect_uri_TEMP (owner_id, redirect_uri) VALUES
+ ('client', 'http://localhost/'),
+ ('client', 'http://localhost:8080/');
+
+INSERT INTO client_grant_type_TEMP (owner_id, grant_type) VALUES
+ ('client', 'authorization_code'),
+ ('client', 'urn:ietf:params:oauth:grant_type:redelegate'),
+ ('client', 'implicit'),
+ ('client', 'refresh_token');
+
+--
+-- Merge the temporary clients safely into the database. This is a two-step process to keep clients from being created on every startup with a persistent store.
+--
+
+INSERT INTO client_details (client_id, client_secret, client_name, dynamically_registered, refresh_token_validity_seconds, access_token_validity_seconds, id_token_validity_seconds, allow_introspection)
+ SELECT client_id, client_secret, client_name, dynamically_registered, refresh_token_validity_seconds, access_token_validity_seconds, id_token_validity_seconds, allow_introspection FROM client_details_TEMP
+ ON CONFLICT
+ DO NOTHING;
+
+INSERT INTO client_scope (scope)
+ SELECT scope FROM client_scope_TEMP, client_details WHERE client_details.client_id = client_scope_TEMP.owner_id
+ ON CONFLICT
+ DO NOTHING;
+
+INSERT INTO client_redirect_uri (redirect_uri)
+ SELECT redirect_uri FROM client_redirect_uri_TEMP, client_details WHERE client_details.client_id = client_redirect_uri_TEMP.owner_id
+ ON CONFLICT
+ DO NOTHING;
+
+INSERT INTO client_grant_type (grant_type)
+ SELECT grant_type FROM client_grant_type_TEMP, client_details WHERE client_details.client_id = client_grant_type_TEMP.owner_id
+ ON CONFLICT
+ DO NOTHING;
+
+--
+-- Close the transaction and turn autocommit back on
+--
+
+COMMIT;
+
+--SET AUTOCOMMIT = ON;
+
+
diff --git a/openid-connect-server-webapp/src/main/resources/db/psql/psql_database_index.sql b/openid-connect-server-webapp/src/main/resources/db/psql/psql_database_index.sql
new file mode 100644
index 0000000000..a641ff8211
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/resources/db/psql/psql_database_index.sql
@@ -0,0 +1,19 @@
+--
+-- Indexes for PostgreSQL
+--
+
+CREATE INDEX IF NOT EXISTS at_tv_idx ON access_token(token_value);
+CREATE INDEX IF NOT EXISTS ts_oi_idx ON token_scope(owner_id);
+CREATE INDEX IF NOT EXISTS at_exp_idx ON access_token(expiration);
+CREATE INDEX IF NOT EXISTS rf_ahi_idx ON refresh_token(auth_holder_id);
+CREATE INDEX IF NOT EXISTS rf_tv_idx ON refresh_token(token_value);
+CREATE INDEX IF NOT EXISTS cd_ci_idx ON client_details(client_id);
+CREATE INDEX IF NOT EXISTS at_ahi_idx ON access_token(auth_holder_id);
+CREATE INDEX IF NOT EXISTS aha_oi_idx ON authentication_holder_authority(owner_id);
+CREATE INDEX IF NOT EXISTS ahe_oi_idx ON authentication_holder_extension(owner_id);
+CREATE INDEX IF NOT EXISTS ahrp_oi_idx ON authentication_holder_request_parameter(owner_id);
+CREATE INDEX IF NOT EXISTS ahri_oi_idx ON authentication_holder_resource_id(owner_id);
+CREATE INDEX IF NOT EXISTS ahrt_oi_idx ON authentication_holder_response_type(owner_id);
+CREATE INDEX IF NOT EXISTS ahs_oi_idx ON authentication_holder_scope(owner_id);
+CREATE INDEX IF NOT EXISTS ac_ahi_idx ON authorization_code(auth_holder_id);
+CREATE INDEX IF NOT EXISTS suaa_oi_idx ON saved_user_auth_authority(owner_id);
diff --git a/openid-connect-server-webapp/src/main/resources/db/tables/psql_database_tables.sql b/openid-connect-server-webapp/src/main/resources/db/psql/psql_database_tables.sql
similarity index 84%
rename from openid-connect-server-webapp/src/main/resources/db/tables/psql_database_tables.sql
rename to openid-connect-server-webapp/src/main/resources/db/psql/psql_database_tables.sql
index da7e697671..be871b7e80 100644
--- a/openid-connect-server-webapp/src/main/resources/db/tables/psql_database_tables.sql
+++ b/openid-connect-server-webapp/src/main/resources/db/psql/psql_database_tables.sql
@@ -3,15 +3,15 @@
--
CREATE TABLE IF NOT EXISTS access_token (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
token_value VARCHAR(4096),
expiration TIMESTAMP,
token_type VARCHAR(256),
refresh_token_id BIGINT,
client_id BIGINT,
auth_holder_id BIGINT,
- id_token_id BIGINT,
- approved_site_id BIGINT
+ approved_site_id BIGINT,
+ UNIQUE(token_value)
);
CREATE TABLE IF NOT EXISTS access_token_permissions (
@@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS access_token_permissions (
);
CREATE TABLE IF NOT EXISTS address (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
formatted VARCHAR(256),
street_address VARCHAR(256),
locality VARCHAR(256),
@@ -30,7 +30,7 @@ CREATE TABLE IF NOT EXISTS address (
);
CREATE TABLE IF NOT EXISTS approved_site (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
user_id VARCHAR(256),
client_id VARCHAR(256),
creation_date TIMESTAMP,
@@ -45,7 +45,7 @@ CREATE TABLE IF NOT EXISTS approved_site_scope (
);
CREATE TABLE IF NOT EXISTS authentication_holder (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
user_auth_id BIGINT,
approved BOOLEAN,
redirect_uri VARCHAR(2048),
@@ -85,7 +85,7 @@ CREATE TABLE IF NOT EXISTS authentication_holder_request_parameter (
);
CREATE TABLE IF NOT EXISTS saved_user_auth (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
name VARCHAR(1024),
authenticated BOOLEAN,
source_class VARCHAR(2048)
@@ -102,7 +102,7 @@ CREATE TABLE IF NOT EXISTS client_authority (
);
CREATE TABLE IF NOT EXISTS authorization_code (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
code VARCHAR(256),
auth_holder_id BIGINT,
expiration TIMESTAMP
@@ -119,29 +119,30 @@ CREATE TABLE IF NOT EXISTS client_response_type (
);
CREATE TABLE IF NOT EXISTS blacklisted_site (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
uri VARCHAR(2048)
);
CREATE TABLE IF NOT EXISTS client_details (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
client_description VARCHAR(1024),
reuse_refresh_tokens BOOLEAN DEFAULT true NOT NULL,
dynamically_registered BOOLEAN DEFAULT false NOT NULL,
allow_introspection BOOLEAN DEFAULT false NOT NULL,
id_token_validity_seconds BIGINT DEFAULT 600 NOT NULL,
-
+ device_code_validity_seconds BIGINT,
+
client_id VARCHAR(256),
client_secret VARCHAR(2048),
access_token_validity_seconds BIGINT,
refresh_token_validity_seconds BIGINT,
-
+
application_type VARCHAR(256),
client_name VARCHAR(256),
token_endpoint_auth_method VARCHAR(256),
subject_type VARCHAR(256),
-
+
logo_uri VARCHAR(2048),
policy_uri VARCHAR(2048),
client_uri VARCHAR(2048),
@@ -150,25 +151,31 @@ CREATE TABLE IF NOT EXISTS client_details (
jwks_uri VARCHAR(2048),
jwks VARCHAR(8192),
sector_identifier_uri VARCHAR(2048),
-
+
request_object_signing_alg VARCHAR(256),
-
+
user_info_signed_response_alg VARCHAR(256),
user_info_encrypted_response_alg VARCHAR(256),
user_info_encrypted_response_enc VARCHAR(256),
-
+
id_token_signed_response_alg VARCHAR(256),
id_token_encrypted_response_alg VARCHAR(256),
id_token_encrypted_response_enc VARCHAR(256),
-
+
token_endpoint_auth_signing_alg VARCHAR(256),
-
+
default_max_age BIGINT,
require_auth_time BOOLEAN,
created_at TIMESTAMP,
initiate_login_uri VARCHAR(2048),
clear_access_tokens_on_refresh BOOLEAN DEFAULT true NOT NULL,
-
+
+ software_statement VARCHAR(4096),
+ software_id VARCHAR(2048),
+ software_version VARCHAR(2048),
+
+ code_challenge_method VARCHAR(256),
+
UNIQUE (client_id)
);
@@ -193,17 +200,17 @@ CREATE TABLE IF NOT EXISTS client_contact (
);
CREATE TABLE IF NOT EXISTS client_redirect_uri (
- owner_id BIGINT,
- redirect_uri VARCHAR(2048)
+ owner_id BIGINT,
+ redirect_uri VARCHAR(2048)
);
CREATE TABLE IF NOT EXISTS client_claims_redirect_uri (
- owner_id BIGINT,
- redirect_uri VARCHAR(2048)
+ owner_id BIGINT,
+ redirect_uri VARCHAR(2048)
);
CREATE TABLE IF NOT EXISTS refresh_token (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
token_value VARCHAR(4096),
expiration TIMESTAMP,
auth_holder_id BIGINT,
@@ -211,8 +218,8 @@ CREATE TABLE IF NOT EXISTS refresh_token (
);
CREATE TABLE IF NOT EXISTS client_resource (
- owner_id BIGINT,
- resource_id VARCHAR(256)
+ owner_id BIGINT,
+ resource_id VARCHAR(256)
);
CREATE TABLE IF NOT EXISTS client_scope (
@@ -226,19 +233,17 @@ CREATE TABLE IF NOT EXISTS token_scope (
);
CREATE TABLE IF NOT EXISTS system_scope (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
scope VARCHAR(256) NOT NULL,
description VARCHAR(4096),
icon VARCHAR(256),
restricted BOOLEAN DEFAULT false NOT NULL,
default_scope BOOLEAN DEFAULT false NOT NULL,
- structured BOOLEAN DEFAULT false NOT NULL,
- structured_param_description VARCHAR(256),
UNIQUE (scope)
);
CREATE TABLE IF NOT EXISTS user_info (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
sub VARCHAR(256),
preferred_username VARCHAR(256),
name VARCHAR(256),
@@ -263,7 +268,7 @@ CREATE TABLE IF NOT EXISTS user_info (
);
CREATE TABLE IF NOT EXISTS whitelisted_site (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
creator_user_id VARCHAR(256),
client_id VARCHAR(256)
);
@@ -274,14 +279,14 @@ CREATE TABLE IF NOT EXISTS whitelisted_site_scope (
);
CREATE TABLE IF NOT EXISTS pairwise_identifier (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
identifier VARCHAR(256),
sub VARCHAR(256),
sector_identifier VARCHAR(2048)
);
CREATE TABLE IF NOT EXISTS resource_set (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
name VARCHAR(1024) NOT NULL,
uri VARCHAR(1024),
icon_uri VARCHAR(1024),
@@ -296,14 +301,14 @@ CREATE TABLE IF NOT EXISTS resource_set_scope (
);
CREATE TABLE IF NOT EXISTS permission_ticket (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
ticket VARCHAR(256) NOT NULL,
permission_id BIGINT NOT NULL,
expiration TIMESTAMP
);
CREATE TABLE IF NOT EXISTS permission (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
resource_set_id BIGINT
);
@@ -313,7 +318,7 @@ CREATE TABLE IF NOT EXISTS permission_scope (
);
CREATE TABLE IF NOT EXISTS claim (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
name VARCHAR(256),
friendly_name VARCHAR(1024),
claim_type VARCHAR(1024),
@@ -331,7 +336,7 @@ CREATE TABLE IF NOT EXISTS claim_to_permission_ticket (
);
CREATE TABLE IF NOT EXISTS policy (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
name VARCHAR(1024),
resource_set_id BIGINT
);
@@ -352,14 +357,28 @@ CREATE TABLE IF NOT EXISTS claim_issuer (
);
CREATE TABLE IF NOT EXISTS saved_registered_client (
- id SERIAL PRIMARY KEY,
+ id BIGSERIAL PRIMARY KEY,
issuer VARCHAR(1024),
registered_client VARCHAR(8192)
);
+CREATE TABLE IF NOT EXISTS device_code (
+ id BIGSERIAL PRIMARY KEY,
+ device_code VARCHAR(1024),
+ user_code VARCHAR(1024),
+ expiration TIMESTAMP NULL,
+ client_id VARCHAR(256),
+ approved BOOLEAN,
+ auth_holder_id BIGINT
+);
+
+CREATE TABLE IF NOT EXISTS device_code_scope (
+ owner_id BIGINT NOT NULL,
+ scope VARCHAR(256) NOT NULL
+);
-CREATE INDEX at_tv_idx ON access_token(token_value);
-CREATE INDEX ts_oi_idx ON token_scope(owner_id);
-CREATE INDEX at_exp_idx ON access_token(expiration);
-CREATE INDEX rf_ahi_idx ON refresh_token(auth_holder_id);
-CREATE INDEX cd_ci_idx ON client_details(client_id);
\ No newline at end of file
+CREATE TABLE IF NOT EXISTS device_code_request_parameter (
+ owner_id BIGINT,
+ param VARCHAR(2048),
+ val VARCHAR(2048)
+);
diff --git a/openid-connect-server-webapp/src/main/resources/db/psql/scopes.sql b/openid-connect-server-webapp/src/main/resources/db/psql/scopes.sql
new file mode 100644
index 0000000000..140c727554
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/resources/db/psql/scopes.sql
@@ -0,0 +1,33 @@
+--
+-- Turn off autocommit and start a transaction so that we can use the temp tables
+--
+
+--SET AUTOCOMMIT = OFF;
+
+START TRANSACTION;
+
+--
+-- Insert scope information into the temporary tables.
+--
+
+INSERT INTO system_scope_TEMP (scope, description, icon, restricted, default_scope) VALUES
+ ('openid', 'log in using your identity', 'user', false, true),
+ ('profile', 'basic profile information', 'list-alt', false, true),
+ ('email', 'email address', 'envelope', false, true),
+ ('address', 'physical address', 'home', false, true),
+ ('phone', 'telephone number', 'bell', false, true),
+ ('offline_access', 'offline access', 'time', false, false);
+
+--
+-- Merge the temporary scopes safely into the database. This is a two-step process to keep scopes from being created on every startup with a persistent store.
+--
+
+INSERT INTO system_scope (scope, description, icon, restricted, default_scope)
+ SELECT scope, description, icon, restricted, default_scope FROM system_scope_TEMP
+ ON CONFLICT(scope)
+ DO NOTHING;
+
+COMMIT;
+
+--SET AUTOCOMMIT = ON;
+
diff --git a/openid-connect-server-webapp/src/main/resources/db/psql/security-schema.sql b/openid-connect-server-webapp/src/main/resources/db/psql/security-schema.sql
new file mode 100644
index 0000000000..bc5d70b880
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/resources/db/psql/security-schema.sql
@@ -0,0 +1,14 @@
+--
+-- Tables for Spring Security's user details service
+--
+
+create table IF NOT EXISTS users(
+ username varchar(50) not null primary key,
+ password varchar(50) not null,
+ enabled boolean not null);
+
+ create table IF NOT EXISTS authorities (
+ username varchar(50) not null,
+ authority varchar(50) not null,
+ constraint fk_authorities_users foreign key(username) references users(username),
+ constraint ix_authority unique (username,authority));
\ No newline at end of file
diff --git a/openid-connect-server-webapp/src/main/resources/db/psql/users.sql b/openid-connect-server-webapp/src/main/resources/db/psql/users.sql
new file mode 100644
index 0000000000..537330278c
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/resources/db/psql/users.sql
@@ -0,0 +1,55 @@
+--
+-- Turn off autocommit and start a transaction so that we can use the temp tables
+--
+
+--SET AUTOCOMMIT FALSE;
+
+START TRANSACTION;
+
+--
+-- Insert user information into the temporary tables. To add users to the HSQL database, edit things here.
+--
+
+INSERT INTO users_TEMP (username, password, enabled) VALUES
+ ('admin','password',true),
+ ('user','password',true);
+
+
+INSERT INTO authorities_TEMP (username, authority) VALUES
+ ('admin','ROLE_ADMIN'),
+ ('admin','ROLE_USER'),
+ ('user','ROLE_USER');
+
+-- By default, the username column here has to match the username column in the users table, above
+INSERT INTO user_info_TEMP (sub, preferred_username, name, email, email_verified) VALUES
+ ('90342.ASDFJWFA','admin','Demo Admin','admin@example.com', true),
+ ('01921.FLANRJQW','user','Demo User','user@example.com', true);
+
+
+--
+-- Merge the temporary users safely into the database. This is a two-step process to keep users from being created on every startup with a persistent store.
+--
+
+INSERT INTO users
+ SELECT username, password, enabled FROM users_TEMP
+ ON CONFLICT(username)
+ DO NOTHING;
+
+INSERT INTO authorities
+ SELECT username, authority FROM authorities_TEMP
+ ON CONFLICT(username, authority)
+ DO NOTHING;
+
+INSERT INTO user_info (sub, preferred_username, name, email, email_verified)
+ SELECT sub, preferred_username, name, email, email_verified FROM user_info_TEMP
+ ON CONFLICT
+ DO NOTHING;
+
+--
+-- Close the transaction and turn autocommit back on
+--
+
+COMMIT;
+
+--SET AUTOCOMMIT TRUE;
+
diff --git a/openid-connect-server-webapp/src/main/resources/log4j.xml b/openid-connect-server-webapp/src/main/resources/log4j.xml
index c3e2bda080..caed28b323 100644
--- a/openid-connect-server-webapp/src/main/resources/log4j.xml
+++ b/openid-connect-server-webapp/src/main/resources/log4j.xml
@@ -1,7 +1,8 @@
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/application-context.xml b/openid-connect-server-webapp/src/main/webapp/WEB-INF/application-context.xml
index bbc10649b2..fdbc37ba72 100644
--- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/application-context.xml
+++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/application-context.xml
@@ -1,7 +1,8 @@
@@ -44,10 +45,41 @@
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -70,7 +102,7 @@
-
+
+
+
+
+
@@ -110,6 +146,7 @@
+
@@ -117,17 +154,34 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
-
+
+
@@ -160,6 +216,10 @@
+
+
+
+
@@ -186,9 +246,15 @@
+
+
-
-
+
+
+
+
+
+
@@ -198,13 +264,13 @@
-
-
-
-
+
+
+
+
@@ -244,6 +310,9 @@
+
+
+
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/assertion-config.xml b/openid-connect-server-webapp/src/main/webapp/WEB-INF/assertion-config.xml
new file mode 100644
index 0000000000..59ea49fe90
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/assertion-config.xml
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/authz-config.xml b/openid-connect-server-webapp/src/main/webapp/WEB-INF/authz-config.xml
index b220267f57..0c5e5019f8 100644
--- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/authz-config.xml
+++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/authz-config.xml
@@ -1,7 +1,6 @@
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/crypto-config.xml b/openid-connect-server-webapp/src/main/webapp/WEB-INF/crypto-config.xml
index 0301caa2f7..36c043a782 100644
--- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/crypto-config.xml
+++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/crypto-config.xml
@@ -1,7 +1,8 @@
+ If you are using a file based HSQLDB you should not run this every time. -->
-
+
-
+
-
-
-
-
+
+
+
+
@@ -48,24 +49,32 @@
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
- -->
+
+
+
+
+
+
+
+
+
+ src/main/resources/db/psql/psql_database_tables.sql -->
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/endpoint-config.xml b/openid-connect-server-webapp/src/main/webapp/WEB-INF/endpoint-config.xml
new file mode 100644
index 0000000000..bcfc14a6c3
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/endpoint-config.xml
@@ -0,0 +1,34 @@
+
+
+
+
+
+
+
+
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/jpa-config.xml b/openid-connect-server-webapp/src/main/webapp/WEB-INF/jpa-config.xml
index 5df98b83c4..afe40844af 100644
--- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/jpa-config.xml
+++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/jpa-config.xml
@@ -1,7 +1,6 @@
+
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/local-config.xml b/openid-connect-server-webapp/src/main/webapp/WEB-INF/local-config.xml
index c980446e2b..e580f6e52a 100644
--- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/local-config.xml
+++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/local-config.xml
@@ -1,7 +1,8 @@
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/locale-config.xml b/openid-connect-server-webapp/src/main/webapp/WEB-INF/locale-config.xml
new file mode 100644
index 0000000000..60cdb6b0f1
--- /dev/null
+++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/locale-config.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/server-config.xml b/openid-connect-server-webapp/src/main/webapp/WEB-INF/server-config.xml
index 2302b19b45..bf9f998652 100644
--- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/server-config.xml
+++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/server-config.xml
@@ -1,7 +1,8 @@
+
+
+
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/spring-servlet.xml b/openid-connect-server-webapp/src/main/webapp/WEB-INF/spring-servlet.xml
index b3467051ce..f37e980ba6 100644
--- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/spring-servlet.xml
+++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/spring-servlet.xml
@@ -1,7 +1,8 @@
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/aboutContent.tag b/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/aboutContent.tag
deleted file mode 100644
index 4d4ca8bb03..0000000000
--- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/aboutContent.tag
+++ /dev/null
@@ -1,5 +0,0 @@
-<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
-
-
-
-
\ No newline at end of file
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/contactContent.tag b/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/contactContent.tag
deleted file mode 100644
index 4f978c4d3f..0000000000
--- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/contactContent.tag
+++ /dev/null
@@ -1,5 +0,0 @@
-<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
-
-
-
-
diff --git a/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/footer.tag b/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/footer.tag
index e1f35831f1..2b95de6dcb 100644
--- a/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/footer.tag
+++ b/openid-connect-server-webapp/src/main/webapp/WEB-INF/tags/footer.tag
@@ -22,17 +22,24 @@
+
-
-
-
-
-
-
-
-
+
+
+ " >
+
-
+