Saturday, 15 May 2010

spring - How to set redirect url after success login using Social Providers -



spring - How to set redirect url after success login using Social Providers -

i need alter redirect url when user succefull logged in using of spring social providers, twitter in case.

i'm getting in every set***url("") null pointer exception times setting don't work too

i tried far setting:

public providersignincontroller signincontroller(connectionfactorylocator connectionfactorylocator, usersconnectionrepository usersconnectionrepository) { providersignincontroller providersignincontroller = new providersignincontroller(connectionfactorylocator, usersconnectionrepository, new csigninadapter(requestcache())); providersignincontroller.setpostsigninurl("/home"); providersignincontroller.setapplicationurl("localhost:8080/home"); homecoming providersignincontroller; }

i tried each 1 of setpostsigninurl , setapplicationurl, separately.

also tried:

@bean public connectcontroller connectcontroller(connectionfactorylocator connectionfactorylocator, connectionrepository connectionrepository) { connectcontroller connectcontroller = new connectcontroller(connectionfactorylocator, connectionrepository); connectcontroller.addinterceptor(new tweetafterconnectinterceptor()); connectcontroller.setapplicationurl("/home"); homecoming connectcontroller; }

i'm using spring social showcase security base of operations this. in case of need i'm posting httpsecurity configuration:

@override protected void configure(httpsecurity http) throws exception { http .formlogin() .loginpage("/signin") .loginprocessingurl("/signin/authenticate") .failureurl("/signin?param.error=bad_credentials") .defaultsuccessurl("/home") .and() .csrf() .and() .logout() .logouturl("/signout") .deletecookies("jsessionid") .and() .authorizerequests() .antmatchers("/admin/**", "/favicon.ico", "/resources/**", "/auth/**", "/signin/**", "/signup/**", "/disconnect/facebook").permitall() .antmatchers("/**").authenticated() .and() .rememberme() .and() .apply(new springsocialconfigurer()); }

try this:

private springsocialconfigurer getspringsocialconfigurer() { springsocialconfigurer config = new springsocialconfigurer(); config.alwaysusepostloginurl(true); config.postloginurl("/home"); homecoming config; }

then alter configure method:

.apply(getspringsocialconfigurer());

spring spring-social

No comments:

Post a Comment