You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Oliver Wulff (JIRA)" <ji...@apache.org> on 2012/10/04 22:49:48 UTC

[jira] [Created] (CXF-4543) Encode multi value claims as multi-value saml attribute

Oliver Wulff created CXF-4543:
---------------------------------

             Summary: Encode multi value claims as multi-value saml attribute
                 Key: CXF-4543
                 URL: https://issues.apache.org/jira/browse/CXF-4543
             Project: CXF
          Issue Type: Improvement
          Components: Services
    Affects Versions: 2.7.0
            Reporter: Oliver Wulff


The current ClaimsAttributeStatementProvider supports encoding for string type value of claims. It's up to the ClaimsHandler to implement multi-value claim support and encoding.

As mentioned here:
http://cxf.547215.n5.nabble.com/SAML-2-0-attibutes-and-claims-naming-convention-td5712967.html

The type of the value in the class Claim has to be changed from String to Object. The ClaimsAttributeStatementProvider can then be configured how to encode multi value claims. Fediz already supports both since FEDIZ-22.



--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4543) Encode multi value claims as multi-value saml attribute

Posted by "Oliver Wulff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470987#comment-13470987 ] 

Oliver Wulff commented on CXF-4543:
-----------------------------------

Maybe something like this is better as it enforces that all list elements are of the same type as required by saml spec.

public class Claim<T> implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = -1151700035195497499L;
    private URI claimType;
    private String issuer;
    private String originalIssuer;
    private transient Principal principal;
    private List<T> values = new ArrayList<T>(1);

    public String getIssuer() {
        return issuer;
    }

    public void setIssuer(String issuer) {
        this.issuer = issuer;
    }

    public String getOriginalIssuer() {
        return originalIssuer;
    }

    public void setOriginalIssuer(String originalIssuer) {
        this.originalIssuer = originalIssuer;
    }

    public URI getClaimType() {
        return claimType;
    }

    public void setClaimType(URI claimType) {
        this.claimType = claimType;
    }

    public Principal getPrincipal() {
        return principal;
    }

    public void setPrincipal(Principal principal) {
        this.principal = principal;
    }

    public void setValues(List<T> values) {
        this.values.clear();
        this.values.addAll(values);
    }

    public void addValue(T s) {
        this.values.add(s);
    }
    
    public List<T> getValues() {
        return values;
    }
}
                
> Encode multi value claims as multi-value saml attribute
> -------------------------------------------------------
>
>                 Key: CXF-4543
>                 URL: https://issues.apache.org/jira/browse/CXF-4543
>             Project: CXF
>          Issue Type: Improvement
>          Components: Services
>    Affects Versions: 2.7.0
>            Reporter: Oliver Wulff
>
> The current ClaimsAttributeStatementProvider supports encoding for string type value of claims. It's up to the ClaimsHandler to implement multi-value claim support and encoding.
> As mentioned here:
> http://cxf.547215.n5.nabble.com/SAML-2-0-attibutes-and-claims-naming-convention-td5712967.html
> The type of the value in the class Claim has to be changed from String to Object. The ClaimsAttributeStatementProvider can then be configured how to encode multi value claims. Fediz already supports both since FEDIZ-22.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4543) Encode multi value claims as multi-value saml attribute

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470468#comment-13470468 ] 

Daniel Kulp commented on CXF-4543:
----------------------------------

I just changed it from String to  List<String> and updated the various methods appropriately.   Can you verify that that would be adequate?   I really prefer the typed collection than a raw object.

                
> Encode multi value claims as multi-value saml attribute
> -------------------------------------------------------
>
>                 Key: CXF-4543
>                 URL: https://issues.apache.org/jira/browse/CXF-4543
>             Project: CXF
>          Issue Type: Improvement
>          Components: Services
>    Affects Versions: 2.7.0
>            Reporter: Oliver Wulff
>
> The current ClaimsAttributeStatementProvider supports encoding for string type value of claims. It's up to the ClaimsHandler to implement multi-value claim support and encoding.
> As mentioned here:
> http://cxf.547215.n5.nabble.com/SAML-2-0-attibutes-and-claims-naming-convention-td5712967.html
> The type of the value in the class Claim has to be changed from String to Object. The ClaimsAttributeStatementProvider can then be configured how to encode multi value claims. Fediz already supports both since FEDIZ-22.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-4543) Encode multi value claims as multi-value saml attribute

Posted by "Oliver Wulff (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-4543?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Oliver Wulff updated CXF-4543:
------------------------------

    Comment: was deleted

(was: Maybe something like this is better as it enforces that all list elements are of the same type as required by saml spec.

public class Claim<T> implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = -1151700035195497499L;
    private URI claimType;
    private String issuer;
    private String originalIssuer;
    private transient Principal principal;
    private List<T> values = new ArrayList<T>(1);

    public String getIssuer() {
        return issuer;
    }

    public void setIssuer(String issuer) {
        this.issuer = issuer;
    }

    public String getOriginalIssuer() {
        return originalIssuer;
    }

    public void setOriginalIssuer(String originalIssuer) {
        this.originalIssuer = originalIssuer;
    }

    public URI getClaimType() {
        return claimType;
    }

    public void setClaimType(URI claimType) {
        this.claimType = claimType;
    }

    public Principal getPrincipal() {
        return principal;
    }

    public void setPrincipal(Principal principal) {
        this.principal = principal;
    }

    public void setValues(List<T> values) {
        this.values.clear();
        this.values.addAll(values);
    }

    public void addValue(T s) {
        this.values.add(s);
    }
    
    public List<T> getValues() {
        return values;
    }
})
    
> Encode multi value claims as multi-value saml attribute
> -------------------------------------------------------
>
>                 Key: CXF-4543
>                 URL: https://issues.apache.org/jira/browse/CXF-4543
>             Project: CXF
>          Issue Type: Improvement
>          Components: Services
>    Affects Versions: 2.7.0
>            Reporter: Oliver Wulff
>
> The current ClaimsAttributeStatementProvider supports encoding for string type value of claims. It's up to the ClaimsHandler to implement multi-value claim support and encoding.
> As mentioned here:
> http://cxf.547215.n5.nabble.com/SAML-2-0-attibutes-and-claims-naming-convention-td5712967.html
> The type of the value in the class Claim has to be changed from String to Object. The ClaimsAttributeStatementProvider can then be configured how to encode multi value claims. Fediz already supports both since FEDIZ-22.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-4543) Encode multi value claims as multi-value saml attribute

Posted by "Oliver Wulff (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-4543?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13470709#comment-13470709 ] 

Oliver Wulff commented on CXF-4543:
-----------------------------------

I agree with you with respect to typed collection. A claim value can be a simple type or a list of simple types. The encoded xml element includes the xsi:type.

Well, the spec also allows complex types:

1237 The <AttributeValue> element supplies the value of a specified SAML attribute. It is of the
1238 xs:anyType type, which allows any well-formed XML to appear as the content of the element.
1239 If the data content of an <AttributeValue> element is of an XML Schema simple type (such as
1240 xs:integer or xs:string), the datatype MAY be declared explicitly by means of an xsi:type declaration
1241 in the <AttributeValue> element. If the attribute value contains structured data, the necessary data
1242 elements MAY be defined in an extension schema.

I thought the object type provides most flexibility. Initially, we would support basic types and list of basic types in the ClaimsAttributeStatementProvider. If anybody wants to support complex types in custom claimshandler he can do that but only with a more flexible type than List<String>.

WDYT?

                
> Encode multi value claims as multi-value saml attribute
> -------------------------------------------------------
>
>                 Key: CXF-4543
>                 URL: https://issues.apache.org/jira/browse/CXF-4543
>             Project: CXF
>          Issue Type: Improvement
>          Components: Services
>    Affects Versions: 2.7.0
>            Reporter: Oliver Wulff
>
> The current ClaimsAttributeStatementProvider supports encoding for string type value of claims. It's up to the ClaimsHandler to implement multi-value claim support and encoding.
> As mentioned here:
> http://cxf.547215.n5.nabble.com/SAML-2-0-attibutes-and-claims-naming-convention-td5712967.html
> The type of the value in the class Claim has to be changed from String to Object. The ClaimsAttributeStatementProvider can then be configured how to encode multi value claims. Fediz already supports both since FEDIZ-22.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira