开发者

How do I specify Open ID Realm in spring security?

开发者 https://www.devze.com 2022-12-26 03:41 出处:网络
We are using Spring security in our application with support for username / password based authentication as well as Open id based authentication.

We are using Spring security in our application with support for username / password based authentication as well as Open id based authentication.

The issue is that google gives a different open id for the return url specified and we have at least 2 different entry points in our application from where open id is configured into our system.

Hence we deci开发者_StackOverflow中文版ded to use open id realm.

https://blog.stackoverflow.com/2009/0...ue-per-domain/

http://groups.google.com/group/googl...unts-api?pli=1

how is it possible to integrate realm into our spring configuration/code ? This is how we are doing it in traditional openid library code:

AuthRequest authReq = consumerManager.authenticate(discovered, someReturnToUrl,"http://www.example.com");

This works and gives same open id for different urls from our site.

our configuration:

Code:

... 
<http auto-config="false"> 
    <!-- <intercept-url> tags are here  --> 
    <remember-me user-service-ref="someRememberedService" key="some key" /> 
    <form-login login-page="/Login.html" authentication-failure-url="/Login.html?error=true" always-use-default-target="false" default-target-url="/MainPage.html"/> 
    <openid-login authentication-failure-url="/Login.html?error=true" always-use-default-target="true" default-target-url="/MainPage.html" user-service-ref="someOpenIdUserService"/> 
</http> 
... 
<beans:bean id="openIdAuthenticationProvider" class="org.springframework.security.providers.openid.OpenIDAuthenticationProvider">
    <custom-authentication-provider />
    <beans:property name="userDetailsService" ref="openIdUserService"/>
</beans:bean>
<beans:bean id="openIdUserService" class="some.package.OpenIDUserDetailsService">
</beans:bean>
... 


This question is really old, it's a shame to let it die without a single answer. There are several tutorials, mostly for SS Version 3:

Tutorial 1: Spring Security 3 - OpenID Login with Google Provider

Tutorial 2: Exploring Google and OpenID login with Spring Security and Spring Roo

0

精彩评论

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