Skip to content

Commit 5c700a0

Browse files
authored
Update clients.sql
Update sql
1 parent 154c132 commit 5c700a0

File tree

1 file changed

+19
-43
lines changed
  • openid-connect-server-webapp/src/main/resources/db/mysql

1 file changed

+19
-43
lines changed

openid-connect-server-webapp/src/main/resources/db/mysql/clients.sql

Lines changed: 19 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -10,50 +10,26 @@ START TRANSACTION;
1010
-- Insert client information into the temporary tables. To add clients to the HSQL database, edit things here.
1111
--
1212

13-
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
14-
('client', 'secret', 'Test Client', false, null, 3600, 600, true);
15-
16-
INSERT INTO client_scope_TEMP (owner_id, scope) VALUES
17-
('client', 'openid'),
18-
('client', 'profile'),
19-
('client', 'email'),
20-
('client', 'address'),
21-
('client', 'phone'),
22-
('client', 'offline_access');
23-
24-
INSERT INTO client_redirect_uri_TEMP (owner_id, redirect_uri) VALUES
25-
('client', 'http://localhost/'),
26-
('client', 'http://localhost:8080/');
13+
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) VALUES
14+
(1, 'secret', 'Test Client', false, null, 3600, 600, true);
15+
16+
INSERT INTO client_scope (owner_id, scope) VALUES
17+
(1, 'openid'),
18+
(1, 'profile'),
19+
(1, 'email'),
20+
(1, 'address'),
21+
(1, 'phone'),
22+
(1, 'offline_access');
23+
24+
INSERT INTO client_redirect_uri (owner_id, redirect_uri) VALUES
25+
(1, 'http://localhost/'),
26+
(1, 'http://localhost:8080/');
2727

28-
INSERT INTO client_grant_type_TEMP (owner_id, grant_type) VALUES
29-
('client', 'authorization_code'),
30-
('client', 'urn:ietf:params:oauth:grant_type:redelegate'),
31-
('client', 'implicit'),
32-
('client', 'refresh_token');
33-
34-
--
35-
-- 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.
36-
--
37-
38-
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)
39-
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
40-
ON DUPLICATE KEY UPDATE client_details.client_id = client_details.client_id;
41-
42-
INSERT INTO client_scope (owner_id, scope)
43-
SELECT id, scope FROM client_scope_TEMP, client_details WHERE client_details.client_id = client_scope_TEMP.owner_id
44-
ON DUPLICATE KEY UPDATE client_scope.owner_id = client_scope.owner_id;
45-
46-
INSERT INTO client_redirect_uri (owner_id, redirect_uri)
47-
SELECT id, redirect_uri FROM client_redirect_uri_TEMP, client_details WHERE client_details.client_id = client_redirect_uri_TEMP.owner_id
48-
ON DUPLICATE KEY UPDATE client_redirect_uri.owner_id = client_redirect_uri.owner_id;
49-
50-
INSERT INTO client_grant_type (owner_id, grant_type)
51-
SELECT id, grant_type FROM client_grant_type_TEMP, client_details WHERE client_details.client_id = client_grant_type_TEMP.owner_id
52-
ON DUPLICATE KEY UPDATE client_grant_type.owner_id = client_grant_type.owner_id;
53-
54-
--
55-
-- Close the transaction and turn autocommit back on
56-
--
28+
INSERT INTO client_grant_type (owner_id, grant_type) VALUES
29+
(1, 'authorization_code'),
30+
(1, 'urn:ietf:params:oauth:grant_type:redelegate'),
31+
(1, 'implicit'),
32+
(1, 'refresh_token');
5733

5834
COMMIT;
5935

0 commit comments

Comments
 (0)