@Override
protected OAuthPrincipal<FacebookAccessTokenContext> getOAuthPrincipal(HttpServletRequest request, HttpServletResponse response,
InteractionState<FacebookAccessTokenContext> interactionState) {
FacebookAccessTokenContext accessTokenContext = interactionState.getAccessTokenContext();
FacebookPrincipal principal = ((GateInFacebookProcessor)getOauthProviderProcessor()).getPrincipal(accessTokenContext);
if (principal == null) {
log.error("Principal was null");
return null;
} else {
if (log.isTraceEnabled()) {
log.trace("Finished Facebook OAuth2 flow with state: " + interactionState);
log.trace("Facebook accessToken: " + principal.getAccessToken());
}
OAuthPrincipal<FacebookAccessTokenContext> oauthPrincipal = OAuthUtils.convertFacebookPrincipalToOAuthPrincipal(
principal, getOAuthProvider(), accessTokenContext);