[
https://issues.apache.org/jira/browse/KNOX-2390?focusedWorklogId=447998&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-447998
]
ASF GitHub Bot logged work on KNOX-2390:
----------------------------------------
Author: ASF GitHub Bot
Created on: 18/Jun/20 19:30
Start Date: 18/Jun/20 19:30
Worklog Time Spent: 10m
Work Description: smolnar82 commented on a change in pull request #348:
URL: https://github.com/apache/knox/pull/348#discussion_r442453649
##########
File path:
gateway-provider-security-pac4j/src/main/java/org/apache/knox/gateway/pac4j/config/AzureADClientConfigurationDecorator.java
##########
@@ -0,0 +1,40 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.knox.gateway.pac4j.config;
+
+import java.util.List;
+import java.util.Map;
+
+import org.pac4j.core.client.Client;
+import org.pac4j.core.http.callback.PathParameterCallbackUrlResolver;
+import org.pac4j.oidc.client.AzureAdClient;
+
+public class AzureADClientConfigurationDecorator implements
ClientConfigurationDecorator {
+ private static final String AZURE_AD_CLIENT_CLASS_NAME =
AzureAdClient.class.getSimpleName();
+
+ @Override
+ public void decorateClients(List<Client> clients, Map<String, String>
properties) {
+ for (Client client : clients) {
+ if (AZURE_AD_CLIENT_CLASS_NAME.equalsIgnoreCase(client.getName())) {
+ // special handling for Azure AD, use path separators instead of query
params
+ ((AzureAdClient) client).setCallbackUrlResolver(new
PathParameterCallbackUrlResolver());
Review comment:
At this point, an instance of `AzureADClient` has already been built by
`org.pac4j.config.builder.OidcClientBuilder` using the same properties object.
While decorating the callback URL resolver we do not need to check those
properties because setting it to an instance of
`PathParameterCallbackUrlResolver` has no any dependency on any property.
P.S: this piece of code was just re-factored out from
`org.apache.knox.gateway.pac4j.filter.Pac4jDispatcherFilter` (as it fits into
the decorator pattern) I did not change the "logic".
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 447998)
Time Spent: 0.5h (was: 20m)
> Configure SAML using provider parameters
> ----------------------------------------
>
> Key: KNOX-2390
> URL: https://issues.apache.org/jira/browse/KNOX-2390
> Project: Apache Knox
> Issue Type: Task
> Components: Server
> Affects Versions: 1.4.0
> Reporter: Sandor Molnar
> Assignee: Sandor Molnar
> Priority: Major
> Fix For: 1.5.0
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Currently, there is a bunch of SAML parameters which the Pac4j federation
> provider knows about and can be used to update SAML 2 configuration:
> * saml.keystorePassword
> * saml.privateKeyPassword
> * saml.keystorePath
> * saml.keystoreAlias
> * saml.identityProviderMetadataPath
> * saml.maximumAuthenticationLifetime
> * saml.serviceProviderEntityId
> * saml.serviceProviderMetadataPath
> * saml.destinationBindingType
> However, there are other SAML 2 configurations that also should be
> configurable via provider parameters. For instance: the default value of
> {{useNameQualifier}} changed from {{'false'}} to {{'true'}} in pac4j
> {{v3.7.0}} (and changed back to {{'false'}} in {{v3.8.2}}) which may cause an
> issue with ADFS integration.
> The purpose of this Jira is to identify a list of SAML 2 configuration that
> should be configurable and make it happen via the Pac4j federation provider
> parameters.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)