Closed GoogleCodeExporter closed 8 years ago
Workaround:
final Profile p;
if (request.getParameter("openid.mode") != null) {
// Need different handling to obtain the Profile.
// See http://code.google.com/p/socialauth/issues/detail?id=178
final Field authProviderField = SocialAuthManager.class.getDeclaredField ("authProvider");
authProviderField.setAccessible (true);
final OpenIdImpl provider = (OpenIdImpl) authProviderField.get (manager);
if (provider == null) throw new RuntimeException ("Internal error: provider not initialized");
p = provider.verifyResponse (requestParameterMap);
} else {
final AuthProvider provider = manager.connect (requestParameterMap);
p = provider.getUserProfile();
}
if (p == null) throw new RuntimeException ("No user profile");
Original comment by Artemciy
on 10 May 2012 at 6:54
Improved workaround in Scala (checks if the authProvider is an OpenIdImpl):
// OpenID needs different handling to obtain the Profile.
// See http://code.google.com/p/socialauth/issues/detail?id=178
lazy val authProvider: AuthProvider = {
val authProviderField = classOf[SocialAuthManager] getDeclaredField "authProvider"
authProviderField setAccessible true
val provider = authProviderField.get (manager) .asInstanceOf[AuthProvider]
if (provider == null) throw new RuntimeException ("Internal error: provider not initialized")
provider
}
val profile: Profile = if (request.getParameter ("openid.mode") != null && authProvider.isInstanceOf[OpenIdImpl]) {
authProvider.asInstanceOf[OpenIdImpl].verifyResponse (requestParameterMap)
} else {
val provider = manager.connect (requestParameterMap)
provider.getUserProfile()
}
if (profile == null) throw new RuntimeException ("No user profile")
Original comment by Artemciy
on 12 May 2012 at 7:14
Hi Artemicy,
Thanks for catching this bug, we have now stored the profile received in the
provider object and returned the same object from getUserProfile().
The code has been checked in but since we do not release the updated jars for
every bugfix, this will be incorporated in the upcoming release.
Thanks again !
Warm regards,
SocialAuth team
Original comment by l...@brickred.com
on 14 May 2012 at 7:54
Original comment by l...@brickred.com
on 14 May 2012 at 8:07
This issue was closed by revision r589.
Original comment by tar...@brickred.com
on 16 May 2012 at 12:28
Code has been checked-in in svn. It will be available in next release
Original comment by tar...@brickred.com
on 16 May 2012 at 12:29
Original issue reported on code.google.com by
Artemciy
on 10 May 2012 at 6:23