Setting up Auth0 with Angular

Im super new to Angular and try to setup Auth0 with your guideline i found here.
https://auth0.com/docs/quickstart/spa/angular/interactive

I always get the following ERROR: * Error: Configuration must be specified either through AuthModule.forRoot or through AuthClientConfig.set

You can find it as an StackBlitz Project here.
https://stackblitz.com/edit/logintest?file=src/app/app.component.ts
It would be great if you could help me.

Hey there!

It’s quite strange. Can you precisely follow the steps described here and let me know if it works for you? Thank you!

Hi Konrad,

yes i was reading this manual as well. It’s just slightly different but throws the exactly same error message. The error implies that something is wrong with these lines but that is exactly whats written in the manual.

AuthModule.forRoot({
      domain: 'dev-733tzn7ozzp856d3.us.auth0.com',
      clientId: 'M1b7zf5tqDu8dXnZmIWR9J6YN1a33voE',
    })

The linked StackBlitz Project is only a few lines test code.
https://stackblitz.com/edit/logintest?file=src/app/app.module.ts

Would be amazing if someone could take a look at it. I was starring at it for hours now and cant find out.

:pray:

Sadly there is still no solution even some people from stackblitz looked over the code.
Auth0 is not working like shown in your example. So it would be really kind if you take a look into it or change your Quickstart tutorial or just post an example file that works on stackblitz.

1 Like

Howan looks like you are using: @auth0/auth0-angular v1.11.1

I am using v2.2.0 and still, even adding step one (adding clientId and domain to app.module.ts) does not work. Error is:

Type ‘{ domain: string; clientId: string; redirectUri: string; }’ has no properties in common with type ‘AuthConfig’.

Is there no Stackblitz example of Auth0 that works? (with a fairly recent version of Angular)?? I look at each one I find online and none of them work.