Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Register
Sign in
Toggle navigation
Menu
UPSMF
userManagement
Commits
c65c7725
Commit
c65c7725
authored
1 year ago
by
Mahesh Maney R
Browse files
Options
Download
Patches
Plain Diff
adding logs while saving user to DB <ManeyMR>.
parent
f9749ef3
main
UAT_quick_fix_keycloak
UPHRH_8164_ErrorHandling
dev
dev_stable
devops-patch
feature_update_fee
payment-webhook
rahu_error_message_fix
uat
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/com/tarento/upsmf/userManagement/utility/KeycloakUserCreator.java
+1
-0
...nto/upsmf/userManagement/utility/KeycloakUserCreator.java
src/main/java/com/tarento/upsmf/userManagement/utility/KeycloakUserCredentialPersister.java
+3
-1
...erManagement/utility/KeycloakUserCredentialPersister.java
with
4 additions
and
1 deletion
+4
-1
src/main/java/com/tarento/upsmf/userManagement/utility/KeycloakUserCreator.java
+
1
−
0
View file @
c65c7725
...
...
@@ -84,6 +84,7 @@ public class KeycloakUserCreator {
String
password
=
((
ArrayNode
)
body
.
get
(
"credentials"
)).
get
(
0
).
get
(
"value"
).
asText
();
responseBody
=
location
;
try
{
logger
.
info
(
"syncing user {} with pwd {}"
,
userName
,
password
);
String
strResponse
=
keycloakUserCredentialPersister
.
persistUserInfo
(
userName
,
password
);
}
catch
(
Exception
ex
){
ex
.
printStackTrace
();
...
...
This diff is collapsed.
Click to expand it.
src/main/java/com/tarento/upsmf/userManagement/utility/KeycloakUserCredentialPersister.java
+
3
−
1
View file @
c65c7725
...
...
@@ -43,7 +43,7 @@ public class KeycloakUserCredentialPersister {
return
environment
.
getProperty
(
property
);
}
public
String
persistUserInfo
(
final
String
userName
,
final
String
password
)
throws
IOException
{
logger
.
info
(
"saving user info to endpoint {}"
,
REGISTRYENDPOINTSAVEUSERINFO
);
HttpClient
httpClient
=
HttpClients
.
createDefault
();
HttpPost
httpPost
=
new
HttpPost
(
REGISTRYENDPOINTSAVEUSERINFO
);
httpPost
.
setHeader
(
HttpHeaders
.
CONTENT_TYPE
,
"application/json"
);
...
...
@@ -51,9 +51,11 @@ public class KeycloakUserCredentialPersister {
"\"username\": "
+
"\""
+
userName
+
"\""
+
","
+
"\"password\": "
+
"\""
+
password
+
"\""
+
","
+
"}"
;
logger
.
info
(
"paayload to save user info {}"
,
requestBody
);
StringEntity
entity
=
new
StringEntity
(
requestBody
);
httpPost
.
setEntity
(
entity
);
org
.
apache
.
http
.
HttpResponse
response
=
httpClient
.
execute
(
httpPost
);
logger
.
info
(
"Response from server {}"
,
response
);
String
responseBody
=
EntityUtils
.
toString
(
response
.
getEntity
());
return
responseBody
;
}
...
...
This diff is collapsed.
Click to expand it.
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!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets