I am using Auth0Lockto integrate social network with application. The social network is integrated successfully but login without social network is not working.
Following is response I am getting from the server:
error "invalid_grant"
I found that this response is got from the custom database login script. How can I use database on auth0 for login purpose in Auth0Lock.
Following is the code
var lock = new Auth0Lock(AUTH_CONFIG.clientId, AUTH_CONFIG.domain, {
oidcConformant: true,
autoclose: true,
auth: {
redirectUrl: AUTH_CONFIG.callbackUrl,
responseType: 'code',
audience: 'https://' + AUTH_CONFIG.domain + '/userinfo',
params: {
scope: 'openid'
}
}
});
lock.on('authenticated', function(authResult) {
if (authResult && authResult.accessToken && authResult.idToken) {
setSession(authResult);
console.log("SSSSS",authResult);
Vue.router.go('/home/customer');
}
});
lock.on('authorization_error', function(err) {
console.log(err);
alert('Error: ' + err.error + '. Check the console for further details.');
displayButtons();
});
When I hard code the id in custom login script I successful login to the application.
callback(null, { id : ‘auth0|5*****dcdd9’,
email: ‘mubeen.ahmed@xzy.com’,
nickname: ‘Mubeen Ahmed’ });