SpoonX / aurelia-authentication

Authentication plugin for aurelia.
http://aurelia-authentication.spoonx.org
MIT License
90 stars 60 forks source link

How to get Auth0 working? #341

Closed THuffam closed 3 years ago

THuffam commented 7 years ago

I am trying to get Auth0 and aurelia-authentication working (I'm new to both).. but I cannot make head or tail of the document https://aurelia-authentication.spoonx.org/auth0.html

It is making a lot of assumptions and/or is missing a lot of information.

Is there a working example somewhere - that would explain it much better. Thanks Tim

RWOverdijk commented 7 years ago

@THuffam I think it's difficult to understand because you're new to both. All you have to do is fill out the config options and use the provider as described on usage:

class Login {
  // use authenticate(providerName) to get third-party authentication
  authenticate(name) {
    return this.authService.authenticate(name)
      .then(response => {
        this.provider[name] = true;
      });
  }
}

Update: Would you be so kind as to write down the steps you took to get it set up for me? We could really use a document describing the steps from someone who's completely new to this! It would help new users a lot.

dabide commented 6 years ago

The documentation says the following:

At the time of writing this, it relies by default on the Auth0 Lock library, that handles both the UI and the logic for all the authentication tasks. You can load it by including a script tag directly in your index.html file, or alternatively with a loader of your choice.

I am using webpack, and had to do the following:

Is this normal, or am I overlooking something obvious?

RWOverdijk commented 6 years ago

That might be because of the way resources in the webpack config work. I'm not sure, I don't use webpack myself. Perhaps it can be solved using the config?

dabide commented 6 years ago

Could be. Anyway, that part seems to work. How is the callback URL handled? Do I need to create a handler for that myself?

RWOverdijk commented 6 years ago

I think that's in the docs?

dabide commented 6 years ago

I couldn't find it, but I might be blind on both eyes. :-)

dabide commented 6 years ago

@RWOverdijk, as far as I can see, the callback stuff isn't documented. Should it be handled by an Aurelia route?

RWOverdijk commented 6 years ago

@dabide I don't know to be honest. I've never used this part of the plugin. But it seems to me that you don't have to handle a thing, and you just use authenticate. Maybe someone on gitter has the answer