GithubHelp home page GithubHelp logo

Comments (4)

chrishawn avatar chrishawn commented on June 3, 2024 1

ok answering my own question it is not true... and i did get this working from the samples without lock.js

my rewrite of auth.login

public login(email, password) {
       this.auth0.login({
            connection: 'Prod-Username-PW-Auth',
            email: email,
            password: password,
            scope: 'openid email offline_access picture',
            device: 'mobile',
        }, (err, authResult) => {
            if (err){
                console.error(err);
                return;
            }else{
                console.log("authenticated");
                this.local.set('id_token', authResult.idToken);

                // Fetch profile information
                this.auth0.getProfile(authResult.idToken, (error, profile) => {
                    if (error) {
                        console.error(error);
                        return;
                    }
                    console.log(profile);
                    profile.user_metadata = profile.user_metadata || {};
                    this.local.set('profile', JSON.stringify(profile));
                    this.user = profile;
                });

                this.local.set('refresh_token', authResult.refreshToken);
                this.zoneImpl.run(() => {
                    this.user = authResult.profile;
                });
                // Schedule a token refresh
                this.scheduleRefresh();
            }
        });
}

from auth0-ionic2.

chenkie avatar chenkie commented on June 3, 2024

Thanks for the suggestion :) We're working on improving our docs to show different scenarios and custom login is one of those. In the meantime, have a look at our Angular 2 custom login doc. Chances are you'll be able to make it work with Ionic 2 from that: https://auth0.com/docs/quickstart/spa/angular2/02-custom-login

from auth0-ionic2.

chrishawn avatar chrishawn commented on June 3, 2024

is it true that custom login only works with a callback url though? because that is not possible in a mobile app that i know of.

from auth0-ionic2.

matiasmoya avatar matiasmoya commented on June 3, 2024

Hi @chrishawn! can you share your auth.service.ts file? I have some doubts related with this line in the constructor for ionic var result = this.auth0.parseHash(window.location.hash);, I think we wont get that location hash modified by auth0 in mobile devices

from auth0-ionic2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.