I have followed this blog and using forcejs plugin to make salesforce authentication in my ionic hybrid app. I am able to login and in popup URL (after redirection to callback) i can see the access token. But when popup come to callback url it does not close automatically and also my callback function is not being called.And i am not able to use the authentication result.
let appId = 'consumer_key';
let loginURL = 'https://login.salesforce.com/';
let oauthCallbackURL = 'http://localhost:8100/callback';
let oauth = OAuth.createInstance(appId, loginURL, oauthCallbackURL);
console.log('=============oauth: ', oauth)
oauth.login().then(oauthResult => {
//can not get here after authentication
DataService.createInstance(oauthResult);
console.log("Logged Into Salesforce Successfully");
});
Use http://localhost:8100/oauthcallback.html as callback
and om the root of your application, create the oauthcallback.html