开发者

How to supply multiple URIs as type value during attribute exchange inside <openid-atribute> tag in security-context.xml?

I am using Spring Security 3.0.5 to provide the authentication and authorization in the web site I am working on... for accessing email attribute I have defined as follows... <security:openid-attribute name="email" type="http://schema.openid.net/contact/email" required="true" count="2"/>

Now I want to provide the support for all the three attribute types All the three types. How can I provide support for multiple attributes.

Than开发者_运维百科ks,


Without some relatively extensive customization, what you describe isn't really possible in Spring Security 3.0.5. You have a couple options that I can think of:

Create different openid-attribute mappings for each possible schema combination. For example:

<security:openid-attribute name="email" type="http://axschema.org/contact/email" required="true" count="2"/>
<security:openid-attribute name="email2" type="http://schema.openid.net/contact/email" required="true" count="2"/>
<security:openid-attribute name="email3" type="http://openid.net/schema/contact/email" required="true" count="2"/>

The pain of this option is that you would need to look at 3 different attribute values when you are trying to do something with these attributes.

Use the Spring Security 3.1 functionality supporting identifier-matcher on each openid-attribute element to narrow the use of particular schemas by OpenID provider. The benefit of this is that you could potentially use only a single attribute name, and expect the identifier-matcher functionality to pick the right one. The downside is that you will need to do the homework of figuring out which OpenID providers support which schemas and attributes.

Unfortunately, not a great solution in either case - welcome to the world of OpenID AX :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜