You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Oliver Wulff <ow...@talend.com> on 2013/03/04 20:23:20 UTC

RE: SAML metadata

Hi there

Are you talking about the usage of the metadata description for web access (browser) or for web services?

There are plans to add the support to Fediz which is a subproject of CXF with a key focus on Web SSO. The Fediz plugin already supports publishing the WS-Federation Metadata document which is based on SAML 2.0 metadata. See here:
http://cxf.apache.org/fediz-metadata.html


Thanks
Oli

------

Oliver Wulff

Blog: http://owulff.blogspot.com
Solution Architect
http://coders.talend.com

Talend Application Integration Division http://www.talend.com

________________________________________
From: geecxf [amiri@ge.com]
Sent: 27 February 2013 21:54
To: users@cxf.apache.org
Subject: Re: SAML metadata

Hi Colm,

Thanks for the prompt response. Do you think this is the kind of feature
that makes sense for CXF to provide? Are there any plans to support it?

In the meanwhile, my thinking is that anyone who wants this feature can
build it by using OpenSAML to parse the metadata and then write code to
configure CXF accordingly. Does this approach make sense?

Thanks,

D



--
View this message in context: http://cxf.547215.n5.nabble.com/SAML-metadata-tp5723816p5723855.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAML metadata

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 08/03/13 01:36, geecxf wrote:
> I'll be sure to share whatever I learn if we are tasked to implement this
> kind of functionality. So far our product owners are saying this is not
> strictly necessary but that could change.
>
> Regarding OAuth, the last time I read the specification it was essentially
> token agnostic. Other than the fact that the token should be compact so that
> you can pass it in redirects and headers, the specification really says
> nothing about what token format to use. I think JWT is what most people are
> using but I've also seen implementations that return SAML assertions. MS
> also has a Simple Web Token (SWT) format which is a basically JWT light. But
> I digress.
>
The actual token is opaque but the grant can take whatever form is 
required, it can be as opaque as a token itself or a may have some 
encoded information carried along the way. So the grant can optionally 
be an assertion (SAML or JWT), to be exchanged for an opaque token.

The token can then can be used by RS or even WS consumers - the latter 
will be supported shortly, so one can imagine a different pattern even 
for WS consumers, where OAuth2 is used to acquire the tokens out of 
band, possibly with the use of SAML/etc assertions and then WS consumers 
only use these binary tokens. I think this pattern will get more 
visibility as OAuth2 itself becomes more deployed

Cheers, Sergey
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SAML-metadata-tp5723816p5724286.html
> Sent from the cxf-user mailing list archive at Nabble.com.



Re: SAML metadata

Posted by geecxf <am...@ge.com>.
I'll be sure to share whatever I learn if we are tasked to implement this
kind of functionality. So far our product owners are saying this is not
strictly necessary but that could change.

Regarding OAuth, the last time I read the specification it was essentially
token agnostic. Other than the fact that the token should be compact so that
you can pass it in redirects and headers, the specification really says
nothing about what token format to use. I think JWT is what most people are
using but I've also seen implementations that return SAML assertions. MS
also has a Simple Web Token (SWT) format which is a basically JWT light. But
I digress.



--
View this message in context: http://cxf.547215.n5.nabble.com/SAML-metadata-tp5723816p5724286.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAML metadata

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 07/03/13 16:18, geecxf wrote:
> OK I'll explain from the start. I apologize for the length of what will
> follow but at least it will provide a solid foundation.
>
> This specific use case I am concerned with is trying to provide a SAML based
> authentication and authorization layer using SAML assertions. A popular
> solution for providing token based auth to RESTful web services is to cram
> tokens into the authorization header and, while I would have preferred a
> more lightweight token format (e.g. JWT), the powers that be demanded SAML
> because it happens to be ubiquitous in their space.

FYI, OAuth2 module also supports SAML assertions as client credentials 
now, it might offer another dimension to the whole story,

>
> Fortunately (or unfortunately), we're not alone in trying this solution and
> as it turns out CXF does have a SAML interceptor that expects the assertion
> in authorization header of an HTTP request. Now we come to the question of:
> who issues these tokens?
>
> Because the solution has to support delegation of auth decisions to a third
> party we have to support federation with an external STS. So a client would
> have to first obtain a token (by unspecified means) from that STS then
> submit its request with token to the back-end web services.
>
> This about the time when a colleague started raving about SAML metadata.
> Initially, I objected to this requirement because I felt that trusting the
> certificate of the STS and a simple audience restriction check would do.
> However, my colleague was very adamant about this "feature" which I
> understood only inasmuch as I had previous experience with
> federationMetadata.xml which is king in the land of Microsoft STSes such as
> ADFS and Azure ACS.
>
> So we went back and forth and I was like "dude we don't need this feature
> and we don't have to adhere to every single SAML spec under the sun and some
> of those specs are really annoying too" to which he would respond "we NEED
> SAML metadata, let's use OpenAM because it's a gift from god" to which I was
> like "yeah OpenAM is pretty cool but it's overkill, we're already using CXF
> stuff and their SAML interceptor is easy to setup". blah blah blah you've
> probably had conversations like this...
>
> So I was like let's keep an open mind and I read up a little bit on SAML
> metadata (you know the drill: a little wikipedia, a little spec perusing, a
> little googling "I hate SAML") and finally I came to the conclusion that
> maybe SAML metadata is a good solution for bootstrapping trust. So I look
> around to see if CXF supports SAML metadata and it looks like it doesn't but
> we should be able to use OpenSAML to provide that feature later.... Hey why
> don't I just ask the CXF guys since they've been so awesome at helping me
> out so far? So I did.
>
> In conclusion. SAML metadata is pretty new to me. But I can see the value in
> this feature when trying to federate with an external STS just as I see the
> value in using FederationMetadata.xml vs the tedium of importing the STS
> certificate into a store, and making potentially many separate configuration
> changes to set up audience restrictions, trusted issuers, token decryption
> etc.
>
> I don't disagree with manual deployment. Although I would point out that
> even if the STS did change their certificate to a self-signed certificate,
> hopefully that doesn't mean that you automatically trust it. For example, if
> I import SAML metadata into ADFS the certificate is not implicitly trusted
> and in fact if it is a self-signed certificate ADFS will complain and not
> trust/issue tokens until I explicitly add that certificate in the trusted
> people certificate store. On the other hand if the STS switches to using
> another certificate issued by a trusted root, I should not have a problem
> with that. Here the metadata seems useful for communicating information
> about the STS in a single document, not to make certificate trust decisions
> for you.
>
> So that's my story and I want to thank those who took time to read it. I
> would appreciate any suggestions, constructive criticism, ideas, help etc.
> As I've stated my understanding of SAML metadata is limited at this point so
> I hope to learn from your responses.
>
Thanks for the above story,

IMHO, optionally supporting the metadata exchange can add to CXF's 
already extensive SAML support, I hope Colm and Oli will support the 
idea :-)

You mentioned earlier that using a JAX-WS endpoint + OpenSaml can offer 
some initial support - may be you can start experimenting and drive the 
process ?

Thanks, Sergey


>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SAML-metadata-tp5723816p5724243.html
> Sent from the cxf-user mailing list archive at Nabble.com.

RE: SAML metadata

Posted by geecxf <am...@ge.com>.
OK I'll explain from the start. I apologize for the length of what will
follow but at least it will provide a solid foundation.

This specific use case I am concerned with is trying to provide a SAML based
authentication and authorization layer using SAML assertions. A popular
solution for providing token based auth to RESTful web services is to cram
tokens into the authorization header and, while I would have preferred a
more lightweight token format (e.g. JWT), the powers that be demanded SAML
because it happens to be ubiquitous in their space.

Fortunately (or unfortunately), we're not alone in trying this solution and
as it turns out CXF does have a SAML interceptor that expects the assertion
in authorization header of an HTTP request. Now we come to the question of:
who issues these tokens?

Because the solution has to support delegation of auth decisions to a third
party we have to support federation with an external STS. So a client would
have to first obtain a token (by unspecified means) from that STS then
submit its request with token to the back-end web services.

This about the time when a colleague started raving about SAML metadata.
Initially, I objected to this requirement because I felt that trusting the
certificate of the STS and a simple audience restriction check would do.
However, my colleague was very adamant about this "feature" which I
understood only inasmuch as I had previous experience with
federationMetadata.xml which is king in the land of Microsoft STSes such as
ADFS and Azure ACS.

So we went back and forth and I was like "dude we don't need this feature
and we don't have to adhere to every single SAML spec under the sun and some
of those specs are really annoying too" to which he would respond "we NEED
SAML metadata, let's use OpenAM because it's a gift from god" to which I was
like "yeah OpenAM is pretty cool but it's overkill, we're already using CXF
stuff and their SAML interceptor is easy to setup". blah blah blah you've
probably had conversations like this...

So I was like let's keep an open mind and I read up a little bit on SAML
metadata (you know the drill: a little wikipedia, a little spec perusing, a
little googling "I hate SAML") and finally I came to the conclusion that
maybe SAML metadata is a good solution for bootstrapping trust. So I look
around to see if CXF supports SAML metadata and it looks like it doesn't but
we should be able to use OpenSAML to provide that feature later.... Hey why
don't I just ask the CXF guys since they've been so awesome at helping me
out so far? So I did.

In conclusion. SAML metadata is pretty new to me. But I can see the value in
this feature when trying to federate with an external STS just as I see the
value in using FederationMetadata.xml vs the tedium of importing the STS
certificate into a store, and making potentially many separate configuration
changes to set up audience restrictions, trusted issuers, token decryption
etc.

I don't disagree with manual deployment. Although I would point out that
even if the STS did change their certificate to a self-signed certificate,
hopefully that doesn't mean that you automatically trust it. For example, if
I import SAML metadata into ADFS the certificate is not implicitly trusted
and in fact if it is a self-signed certificate ADFS will complain and not
trust/issue tokens until I explicitly add that certificate in the trusted
people certificate store. On the other hand if the STS switches to using
another certificate issued by a trusted root, I should not have a problem
with that. Here the metadata seems useful for communicating information
about the STS in a single document, not to make certificate trust decisions
for you.

So that's my story and I want to thank those who took time to read it. I
would appreciate any suggestions, constructive criticism, ideas, help etc.
As I've stated my understanding of SAML metadata is limited at this point so
I hope to learn from your responses.



--
View this message in context: http://cxf.547215.n5.nabble.com/SAML-metadata-tp5723816p5724243.html
Sent from the cxf-user mailing list archive at Nabble.com.

RE: SAML metadata

Posted by Oliver Wulff <ow...@talend.com>.
I'm still confused about your use case. On the one hand you mention SAML SSO, OpenAM  which is for web application SSO and on the other hand you mention Web Services authentication. In both cases, the SAML metadata specification can be used to define the trust relationship in a standard way.

>>>
The SAML metadata specification describes a "standard" way to share this
kind of information between the relying party and the asserting party.
Technically speaking, you could come up with your own way of sharing that
information but SAML metadata makes life easier to share.
>>>
Agreed.

>>>
In a way this is similar to the FederationMetadata.xml file you exchange to
establish trust when using WS-Federation.
>>>
The WS-Federation specification recommends to use EntitiesDescriptor instead of FederationMetadata, as stated here:
http://docs.oasis-open.org/wsfed/federation/v1.2/os/ws-federation-1.2-spec-os.html#_Toc223174943

But there are a few extensions as the SAML specification stack (core, binding, profile) has got a strong focus on Web Application SSO (not Web Services). OpenAM implements the SAML specification stack.

One important thing to note is that WS-Federation specification defines the use cases for Web Services communication (in combination with an STS) as well as Browser to Web Application communication (Passive Requestor Profile). The latter is already supported in the subproject Fediz of CXF including SAML Metadata support (see my link in my first mail).

There are more or less the following specifications relevant for SAML in combination with Web Services which are WS-Security SAML Token profile, WS-Trust, WS-SecurityPolicy and WS-Federation (no explicit dependency to a single security token format) where SAML Metadata specification can be used to define the trust relationships.

Which use case are you looking into where SAML metadata is used: Browser or Web Services?

Last but not least, I prefer to have a manual deployment step required in establishing the trust with the IDP/STS because otherwise, the IDP can just change the signing certificate and replace it at a latter stage by a self-signed certificate and all SP do still trust it.



------

Oliver Wulff

Blog: http://owulff.blogspot.com
Solution Architect
http://coders.talend.com

Talend Application Integration Division http://www.talend.com

________________________________________
From: geecxf [amiri@ge.com]
Sent: 06 March 2013 22:59
To: users@cxf.apache.org
Subject: Re: SAML metadata

FYI - the specification is here:

http://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf

If you want to see one implementation of this take a look at ForgeRock's
OpenAM.

In a way this is similar to the FederationMetadata.xml file you exchange to
establish trust when using WS-Federation.




--
View this message in context: http://cxf.547215.n5.nabble.com/SAML-metadata-tp5723816p5724197.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAML metadata

Posted by geecxf <am...@ge.com>.
FYI - the specification is here:

http://docs.oasis-open.org/security/saml/v2.0/saml-metadata-2.0-os.pdf

If you want to see one implementation of this take a look at ForgeRock's
OpenAM.

In a way this is similar to the FederationMetadata.xml file you exchange to
establish trust when using WS-Federation.




--
View this message in context: http://cxf.547215.n5.nabble.com/SAML-metadata-tp5723816p5724197.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAML metadata

Posted by geecxf <am...@ge.com>.
This is not something that happens every request. It happens when you make a
decision to trust an external identity provider so it is a relatively rare
event. The key word here is "external". For example, suppose you decide to
trust a third party STS to issue SAML tokens that you can use for web
service auth.

Let me make this more concrete. Somewhere in an org an STS exists that is
plugged into an existing identity and attribute store. You want to use
tokens issued by that service to authenticate web service calls.

However, the most popular use case for SAML data is to establish trust
between identity provider and service provider when setting up SAML SSO.



--
View this message in context: http://cxf.547215.n5.nabble.com/SAML-metadata-tp5723816p5724196.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: SAML metadata

Posted by Sergey Beryozkin <sb...@gmail.com>.
On 06/03/13 17:22, geecxf wrote:
> No. I am talking about metadata used to exchange out-of-band information
> about what asserting party a relying party should trust and what relying
> party an asserting provider should issue tokens for.
>
> Currently, in CXF you establish trust between the relying party and the
> asserting provider (i.e. service provider and identity provider) by
> exchanging certificates out-of-band. This gives the service provider a way
> to ascertain that the SAML token was not tampered with. However, the service
> provider may want to validate other aspects of the assertion such as the
> issuer id and audience restriction. Conversely, you may want to tightly
> control what relying parties an STS will issue tokens for. You may also want
> to associate a public certificate with the relying party so that the STS can
> encrypt parts of the assertion so that only the relying party can use them.
>
> The SAML metadata specification describes a "standard" way to share this
> kind of information between the relying party and the asserting party.
> Technically speaking, you could come up with your own way of sharing that
> information but SAML metadata makes life easier to share.

Does it imply the metadata exchange must've happened before the RP 
endpoints have been started ?

It seems that if it happens via a back channel while trying to validate 
a given client's request, then it will affect the performance  ?

Cheers, Sergey

>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/SAML-metadata-tp5723816p5724147.html
> Sent from the cxf-user mailing list archive at Nabble.com.


-- 

RE: SAML metadata

Posted by geecxf <am...@ge.com>.
No. I am talking about metadata used to exchange out-of-band information
about what asserting party a relying party should trust and what relying
party an asserting provider should issue tokens for.

Currently, in CXF you establish trust between the relying party and the
asserting provider (i.e. service provider and identity provider) by
exchanging certificates out-of-band. This gives the service provider a way
to ascertain that the SAML token was not tampered with. However, the service
provider may want to validate other aspects of the assertion such as the
issuer id and audience restriction. Conversely, you may want to tightly
control what relying parties an STS will issue tokens for. You may also want
to associate a public certificate with the relying party so that the STS can
encrypt parts of the assertion so that only the relying party can use them.

The SAML metadata specification describes a "standard" way to share this
kind of information between the relying party and the asserting party.
Technically speaking, you could come up with your own way of sharing that
information but SAML metadata makes life easier to share.



--
View this message in context: http://cxf.547215.n5.nabble.com/SAML-metadata-tp5723816p5724147.html
Sent from the cxf-user mailing list archive at Nabble.com.