Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Open Subsurface Data Universe Software
Platform
System
Schema
Commits
5a598ffc
Commit
5a598ffc
authored
Aug 26, 2021
by
Vibhuti Sharma [Microsoft]
Browse files
nit
parent
52f5d9d1
Pipeline
#61218
failed with stages
in 82 minutes and 18 seconds
Changes
2
Pipelines
4
Hide whitespace changes
Inline
Side-by-side
provider/schema-azure/src/main/java/org/opengroup/osdu/schema/security/AzureIstioSecurityFilter.java
View file @
5a598ffc
...
...
@@ -3,6 +3,7 @@ package org.opengroup.osdu.schema.security;
import
com.azure.spring.autoconfigure.aad.UserPrincipal
;
import
com.nimbusds.jwt.JWTClaimsSet
;
import
net.minidev.json.JSONArray
;
import
org.opengroup.osdu.core.common.model.http.AppException
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.boot.autoconfigure.condition.ConditionalOnProperty
;
...
...
@@ -48,7 +49,7 @@ public class AzureIstioSecurityFilter extends OncePerRequestFilter {
protected
void
doFilterInternal
(
final
HttpServletRequest
servletRequest
,
final
HttpServletResponse
servletResponse
,
final
FilterChain
filterChain
)
throws
ServletException
,
IOException
{
final
String
istioPayload
=
servletRequest
.
getHeader
(
X_ISTIO_CLAIMS_PAYLOAD
);
LOGGER
.
info
(
String
.
format
(
"Received headers list:
%s
"
,
Collections
.
list
(
servletRequest
.
getHeaderNames
()))
)
;
LOGGER
.
debug
(
"Received headers list:
{}
"
,
Collections
.
list
(
servletRequest
.
getHeaderNames
()));
try
{
if
(
hasText
(
istioPayload
))
{
...
...
@@ -77,7 +78,7 @@ public class AzureIstioSecurityFilter extends OncePerRequestFilter {
}
}
catch
(
ParseException
ex
)
{
LOGGER
.
error
(
"Failed to initialize UserPrincipal."
,
ex
);
throw
new
Servlet
Exception
(
ex
);
throw
new
App
Exception
(
500
,
"Unable to parse claims in istio payload"
,
ex
.
getMessage
()
);
}
try
{
filterChain
.
doFilter
(
servletRequest
,
servletResponse
);
...
...
provider/schema-azure/src/main/resources/application.properties
View file @
5a598ffc
...
...
@@ -21,9 +21,9 @@ AUTHORIZE_API_KEY=${entitlements_service_api_key}
# Azure AD configuration, commented below settings to disable AAD AuthN,
# Uncomment it In the Istio AUTHN disabled Scenario
azure.activedirectory.client-id
=
${aad_client_id}
azure.activedirectory.AppIdUri
=
api://${azure.activedirectory.client-id}
azure.activedirectory.session-stateless
=
true
#
azure.activedirectory.client-id=${aad_client_id}
#
azure.activedirectory.AppIdUri=api://${azure.activedirectory.client-id}
#
azure.activedirectory.session-stateless=true
# Azure CosmosDB configuration
azure.cosmosdb.database
=
${cosmosdb_database}
...
...
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