SocialAuth 入門ガイドには、次のコード サンプルがあります。
// get the auth provider manager from session
SocialAuthManager manager = (SocialAuthManager)session.getAttribute("authManager");
// call connect method of manager which returns the provider object.
// Pass request parameter map while calling connect method.
AuthProvider provider = manager.connect(paramsMap);
// get profile
Profile p = provider.getUserProfile();
// you can obtain profile information
System.out.println(p.getFirstName());
// OR also obtain list of contacts
List<Contact> contactsList = provider.getContactList();
3 ~ 4 行目のコメントは、リクエスト パラメータ マップを に渡す必要があることを示していますmanager.connect()
。私は試した:
manager.connect(request.getParameterMap());
しかし、それは与えます
java.lang.ClassCastException: [Ljava.lang.String; cannot be cast to java.lang.String
によって返されたマップを渡す代わりに、独自のパラメーター マップを作成する必要がありますrequest.getParameterMap()
か?