I would like to create a custom-login form for my Ionic 2+ application.
Currently the only recommended way to do that is the use of the auth0 cordova library.
I have to admit, that I’m not at all fan of this solution: I wan’t to use an integrated custom form in my application and I don’t want to use a browser based authentication. The user experience using a browser based authentication is poor, it doesn’t look good and it’s known to cause problems and it’s confusing my users. Also it’s not compatible with native Facebook login, which I wan’t to add later.
Sadly it seems auth0 is trying to make the use of alternative methods as difficult as possible. For example - using auth0.js in Ionic does only work in a very limited way:
auth0.client.login({
realm: 'Username-Password-Authentication',
username,
password
}, (err, authResult) => resolve(this.handleAuthenticationResponse(err, authResult)));
});
Does not return a refresh_token, even if you added “offline_access” to the scope.
auth0.renewAuth
most likely does not work, as it’s intended to use a callback (which is most likely not working).
So which options do I have if I wan’t to integrate auth0 into my Ionic app without using auth0-cordova and without having to write everything from scratch to get it done?