Added a config properties for a long-time access token expiry and
excluded refresh tokens for public clients in OAuth2 token responses.
Change-Id: Ie1cbf65bc605ab93202642030db9a1893a1cc9a8
diff --git a/full/src/main/resources/db/sqlite/V1.4__oauth2_tables.sql b/full/src/main/resources/db/sqlite/V1.4__oauth2_tables.sql
index 00be974..abb9199 100644
--- a/full/src/main/resources/db/sqlite/V1.4__oauth2_tables.sql
+++ b/full/src/main/resources/db/sqlite/V1.4__oauth2_tables.sql
@@ -77,13 +77,13 @@
id INTEGER PRIMARY KEY AUTOINCREMENT,
token VARCHAR(255) NOT NULL,
user_id VARCHAR(100) DEFAULT NULL,
- client_id VARCHAR(100) DEFAULT NULL,
created_date TIMESTAMP NOT NULL,
expiry_date TIMESTAMP NOT NULL,
is_revoked BOOLEAN DEFAULT 0,
user_auth_time TIMESTAMP NOT NULL,
refresh_token INTEGER DEFAULT NULL,
- FOREIGN KEY (client_id)
+ client VARCHAR(100) DEFAULT NULL,
+ FOREIGN KEY (client)
REFERENCES oauth2_client(id)
ON DELETE CASCADE
FOREIGN KEY (refresh_token)
diff --git a/full/src/main/resources/db/test/V3.5__insert_oauth2_clients.sql b/full/src/main/resources/db/test/V3.5__insert_oauth2_clients.sql
index 33330c1..d179fdc 100644
--- a/full/src/main/resources/db/test/V3.5__insert_oauth2_clients.sql
+++ b/full/src/main/resources/db/test/V3.5__insert_oauth2_clients.sql
@@ -21,7 +21,15 @@
"This is a test nonsuper confidential client.",
"http://third.party.com/confidential", 1712550103);
-
+INSERT INTO oauth2_client(id,name,secret,type,super,
+ redirect_uri,registered_by, description,url,url_hashcode)
+VALUES ("52atrL0ajex_3_5imd9Mgw","confidential client 2",
+ "$2a$08$vi1FbuN3p6GcI1tSxMAoeuIYL8Yw3j6A8wJthaN8ZboVnrQaTwLPq",
+ "CONFIDENTIAL", 0,
+ "https://example.client.de/redirect", "system",
+ "This is a test nonsuper confidential client.",
+ "http://example.client.de", 1535365678);
+
INSERT INTO oauth2_client(id,name,secret,type,super,
redirect_uri, registered_by, description, url,url_hashcode)
VALUES ("8bIDtZnH6NvRkW2Fq","third party client",null,
diff --git a/full/src/main/resources/kustvakt.conf b/full/src/main/resources/kustvakt.conf
index 68577ae..62546c6 100644
--- a/full/src/main/resources/kustvakt.conf
+++ b/full/src/main/resources/kustvakt.conf
@@ -60,6 +60,7 @@
oauth2.max.attempts = 1
# expiry in seconds (S), minutes (M), hours (H), days (D)
oauth2.access.token.expiry = 1D
+oauth2.access.token.long.expiry = 365D
oauth2.refresh.token.expiry = 90D
oauth2.authorization.code.expiry = 10M
# -- scopes separated by space