I am using socialauth to login via facebook in my jsf application. It works fine. If i click a jsf commandlink's action method i am connecting to facebook. like below
public void socialConnect(){
SocialAuthConfig config = SocialAuthConfig.getDefault();
config.load(new FileInputStream(new File("auth.properties")));
SocialAuthManager manager = new SocialAuthManager();
manager.setSocialAuthConfig(config);
String authenticationURL = manager.getAuthenticationUrl(providerID,
"http://mudomain.com/page");
FacesContext.getCurrentInstance().getExternalContext()
.redirect(authenticationURL);
}
In index.xhtml page
<p:commandLink id="facebook" ajax="false" value="Login with facebook"
action="#{userSession.socialConnect}">
<f:setPropertyActionListener target="#userSession.providerID}"
value="facebook" />
</p:commandLink>
this is working fine, But the OAuth page opening in the same window. i need to open the facebook page in new window? is there any configuration available...? any help would be appreciated.
EDIT: if i use
<h:commandLink target="_blank" id="facebook" ajax="false" value="Login with facebook"
action="#{userSession.socialConnect}">
<f:setPropertyActionListener target="#userSession.providerID}"
value="facebook" />
</h:commandLink>
the above code facebook loginpage opening in new tab but after logged in i need to close the window and redired to my page. any help would be appreciated.