First Party - Skip consent screen

Hi,

I am using Auth0 in my web app and enabled skipping of consent screen for first party. However when user signs up and login it is still asking for consent. How can I skip the consent screen.

Hey there @tbansal!

I did some research and I found those articles that might be helpful:

https://auth0.com/docs/api-auth/user-consent

Let me know if you have more questions!

I already checked that document. But my application is not skipping it.

1 Like

As of now I need you to provide me with more context as you said you’ve followed the tutorial and it didn’t work for you then I need more details. Can you share what building blocks you use to build your app? Steps you take etc. Which version of Auth0.js you use?

Hey there!

Have you had a chance to see my last message?

Hey Konrad,

Yes sure. We are using angular 6 and following package from npm -
auth0-lock - 11.12.1
Auth0.js - 9.9.0

I have Allow Skip consent enabled on my Application.
My site is hosted on https also.

Is there any other need for it in lock configuration etc to avoid it. I do not have localhost anywhere in allowed callbacks etc.

Let me try to reproduce it and discuss it internally what might be the potential reason. I’ll get back to you as soon as I have any info to relay!

I have Allow Skip consent enabled on my Application.

Just to confirm, you are setting this in the API settings under Dashboard > APIs, not under Dashboard > Applications, right?

Also, in your authorization request in your client application, you are providing the API identifier of this API as the audience, correct? Because otherwise, if this audience is missing, it will also not work.

Hi, I have the exact same issue, and I too have enabled skipping user consent.

This is the right and clear answer

@tbansal I am using angular as well, and if you follow Auth0 angular tutorial, you need to add “audience” in the auth.service.ts

auth0Client$ = (from(
createAuth0Client({
  domain: environment.auth0.domain,
  client_id: environment.auth0.clientId,
  redirect_uri: `${window.location.origin}/${environment.auth0.redirectURI}`,
  ui_locales: this.globals.language,
  audience: environment.auth0.audience,
})
) as Observable<Auth0Client>).pipe(
 shareReplay(1), // Every subscription receives the same shared value
 catchError(err => throwError(err))
);

public login(redirectPath: string = '/') {
// A desired redirect path can be passed to login method
// (e.g., from a route guard)
// Ensure Auth0 client instance exists
this.constant.auth0Client$.subscribe((client: Auth0Client) => {
  // Call method to log in
  client.loginWithRedirect({
    redirect_uri: `${window.location.origin}/${environment.auth0.redirectURI}`,
    appState: { target: redirectPath },
    connection: environment.auth0.connection,
    ui_locales: this.globals.language,
    audience: environment.auth0.audience,
  });
 });
}
2 Likes

Thank you for sharing that @chris16 with the rest of people in this thread!

Thanks for the detailed reply.
What would normally be the value of environment.auth0.audience and does it make sense to pass it statically rather than from env. variable?

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.