[keycloak-user] Social Login Fails
Srikar Nuvvula
nsrikar at yahoo.com
Thu Dec 1 13:23:06 EST 2016
Hi,
I am new to using keycloak. I am trying to get social login work with my angularjs app but I am having issues that I can't see to get over. Here are steps I followed but login failed.
1. Setup facebook auth provider in keycloak2. Created client id with public type in keyclock3. Setup an app in facebook and populated redirect url which is (http://localhost:8080/auth/realms/faceauth/broker/facebook/endpoint)4. Extracted clientid and secrect from facebook app and populated it on facebook id provider in keycloak 5. Using keycloack js adapter I invoked the login call (uses the following code)
***************************************************************************// on every request, authenticate user firstangular.element(document).ready(() => { window._keycloak = window._keycloak = Keycloak('keycloak/keycloak.json');//new Keycloak({ url: 'http://localhost:8080/auth', realm: 'faceauth', clientId: 'facedemo' }); window._keycloak.init({ onLoad: 'login-required' }) .success((authenticated) => { if(authenticated) { window._keycloak.loadUserProfile().success(function(profile){ angular.bootstrap(document, ['keycloak-tutorial']); // manually bootstrap Angular }); } else { window.location.reload(); } }) .error(function () { alert("auth failed") //window.location.reload(); });});********************************************************************************6. I am presented facebook login when I key in the details and login the control comes back to my app on localhost but goes into error block and displays "auth failed" message.
I don't know what's happening. I don't have any more error information to debug. What's the best way to understand what's going on? Please help.
Thanks much
More information about the keycloak-user
mailing list