Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
I
Indexer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSDU
OSDU Data Platform
System
Indexer
Commits
4a752c69
Commit
4a752c69
authored
2 years ago
by
Shrikant Garg
Browse files
Options
Downloads
Patches
Plain Diff
added keycloak change
parent
873e9669
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!378
No more retry attempts for schema not found
,
!341
added keycloak change
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
provider/indexer-ibm/src/main/java/org/opengroup/osdu/indexer/ibm/util/KeyCloakProvider.java
+12
-2
12 additions, 2 deletions
...org/opengroup/osdu/indexer/ibm/util/KeyCloakProvider.java
with
12 additions
and
2 deletions
provider/indexer-ibm/src/main/java/org/opengroup/osdu/indexer/ibm/util/KeyCloakProvider.java
+
12
−
2
View file @
4a752c69
...
...
@@ -13,7 +13,7 @@ import java.net.URLEncoder;
import
java.util.HashMap
;
import
java.util.Map
;
import
java
x
.net.
ssl.
Http
s
URLConnection
;
import
java.net.HttpURLConnection
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
...
...
@@ -42,10 +42,20 @@ public class KeyCloakProvider {
@Value
(
"${ibm.keycloak.client_secret}"
)
private
String
clientSecret
;
@Value
(
"${partition.keycloak.accept_http:false}"
)
private
boolean
accept_kc_http
;
public
String
getToken
(
String
user
,
String
password
)
throws
IOException
{
String
endpoint
=
String
.
format
(
"https://%s/auth/realms/%s/protocol/openid-connect/token"
,
url
,
realm
);
if
(
accept_kc_http
)
{
endpoint
=
String
.
format
(
"http://%s/auth/realms/%s/protocol/openid-connect/token"
,
url
,
realm
);
}
URL
url
=
new
URL
(
endpoint
);
Http
s
URLConnection
con
=
(
Http
s
URLConnection
)
url
.
openConnection
();
HttpURLConnection
con
=
(
HttpURLConnection
)
url
.
openConnection
();
con
.
setRequestMethod
(
"POST"
);
con
.
setRequestProperty
(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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