Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 49D1519C6C for ; Tue, 12 Apr 2016 19:33:26 +0000 (UTC) Received: (qmail 57827 invoked by uid 500); 12 Apr 2016 19:33:25 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 57728 invoked by uid 500); 12 Apr 2016 19:33:25 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 57219 invoked by uid 99); 12 Apr 2016 19:33:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 12 Apr 2016 19:33:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 87FF12C1F56 for ; Tue, 12 Apr 2016 19:33:25 +0000 (UTC) Date: Tue, 12 Apr 2016 19:33:25 +0000 (UTC) From: "Andrei Shakirin (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Closed] (CXF-6859) STSTokenValidator: logging and exception handling improvement MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-6859?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Andrei Shakirin closed CXF-6859. -------------------------------- > STSTokenValidator: logging and exception handling improvement > ------------------------------------------------------------- > > Key: CXF-6859 > URL: https://issues.apache.org/jira/browse/CXF-6859 > Project: CXF > Issue Type: Improvement > Components: JAX-RS Security > Affects Versions: 3.1.6 > Reporter: Andrei Shakirin > Assignee: Andrei Shakirin > Fix For: 3.2.0 > > > The STSTokenValidator doesn't log the reason of authentication error in case of local validation. > The STSTokenValidator tries to validate token locally and, in case if it wasn't successful, delegate the validation to STS: > public Credential validate(Credential credential, RequestData data) throws WSSecurityException { > > if (isValidatedLocally(credential, data)) { > return credential; > } > > return validateWithSTS(credential, (Message)data.getMsgContext()); > } > That causes a bit confusing error messages in log, if user rely on local validation only. > For example, if STS certificate is missing in service keystore it throws: > WARNING: Assertion can not be validated: java.lang.NullPointerException > at org.apache.cxf.rt.security.utils.SecurityUtils.getSecurityPropertyValue(SecurityUtils.java:170) > at org.apache.cxf.ws.security.trust.STSUtils.getClientWithIssuer(STSUtils.java:106) > at org.apache.cxf.ws.security.trust.STSUtils.getClient(STSUtils.java:92) > at org.apache.cxf.ws.security.trust.STSTokenValidator.validateWithSTS(STSTokenValidator.java:128) > at org.apache.cxf.ws.security.trust.STSTokenValidator.validate(STSTokenValidator.java:80) > at org.apache.cxf.rs.security.saml.AbstractSamlInHandler.validateToken(AbstractSamlInHandler.java:181) > Then, to find a real reason of failed local validation it is necessary to debug the code. > Suggestion: in case if alwaysValidateToSts is false (default value) log the reason of failed local validation on warning level. -- This message was sent by Atlassian JIRA (v6.3.4#6332)