Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Genesys PGR
Genesys Catalog
Genesys Catalog Server
Commits
427e2e2e
Commit
427e2e2e
authored
Nov 13, 2017
by
Matija Obreza
Committed by
Andrey Lugovskiy
Nov 13, 2017
Browse files
Made default OAuth client id and secret configurable
parent
8e2e97e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
genesys-catalog-server/docker/review-compose-template.yml
View file @
427e2e2e
...
...
@@ -9,6 +9,8 @@ services:
-
host.name=catalog-${CI_COMMIT_REF_SLUG}.review.genesys-pgr.org
-
default.admin.email=${DEFAULT_ADMIN_EMAIL}
-
default.admin.password=${DEFAULT_ADMIN_PASSWORD}
-
default.oauthclient.clientId=${DEFAULT_OAUTHCLIENT_ID}
-
default.oauthclient.clientSecret=${DEFAULT_OAUTHCLIENT_SECRET}
-
robots.allow=false
-
db.url=jdbc:hsqldb:mem:catalog;sql.syntax_mys=true;sql.ignore_case=true
-
db.driverClassName=org.hsqldb.jdbc.JDBCDriver
...
...
genesys-catalog-server/src/main/java/org/genesys/catalog/server/components/StartupInitializer.java
View file @
427e2e2e
...
...
@@ -45,8 +45,12 @@ public class StartupInitializer implements InitializingBean {
@Value
(
"${default.admin.password}"
)
private
String
defaultAdminPassword
;
@Value
(
"${client.secret}"
)
private
String
clientSecret
;
@Value
(
"${default.oauthclient.clientId}"
)
private
String
defaultOAuthClientId
;
@Value
(
"${default.oauthclient.clientSecret}"
)
private
String
defaultOAuthClientSecret
;
@Autowired
private
UserRepository
userRepository
;
...
...
@@ -79,8 +83,8 @@ public class StartupInitializer implements InitializingBean {
if
(
oauthClientRepository
.
count
()
==
0
)
{
LOG
.
warn
(
"Creating default OAuth client my-trusted-client"
);
final
OAuthClient
client
=
new
OAuthClient
();
client
.
setClientId
(
"my-trusted-c
lient
"
);
client
.
setClientSecret
(
c
lientSecret
);
client
.
setClientId
(
defaultOAuthC
lient
Id
);
client
.
setClientSecret
(
defaultOAuthC
lientSecret
);
client
.
getAuthorizedGrantTypes
().
add
(
"authorization_code"
);
client
.
getAuthorizedGrantTypes
().
add
(
"password"
);
client
.
getAuthorizedGrantTypes
().
add
(
"client_credentials"
);
...
...
genesys-catalog-server/src/main/resources/application.properties
View file @
427e2e2e
...
...
@@ -16,7 +16,8 @@ db.pool.maxActive=10
default.admin.email
=
admin@example.com
default.admin.password
=
Admin123!
client.secret
=
my-secret-client
default.oauthclient.clientId
=
my-trusted-client
default.oauthclient.clientSecret
=
my-secret-client
#google properties
google.consumerKey
=
...
...
genesys-catalog-server/src/test/resources/application.properties
View file @
427e2e2e
...
...
@@ -18,6 +18,9 @@ db.pool.maxActive=5
default.admin.email
=
admin@example.com
default.admin.password
=
Admin123!
default.oauthclient.clientId
=
my-trusted-client
default.oauthclient.clientSecret
=
my-secret-client
#file repository
file.repository.path
=
/file_repository
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment