CrahunGit/Auth0BlazorWebAppSample

Counter page generate a new call of Auth0 login

Closed this issue · 17 comments

Hello

If I open the Counter page I receive a lot of not expected data:

image

It seems that the API call open a new login on Auth0.

If you call https://localhost:7078/hello directly the error does not occur.

Could you check this please.

If I navigate with the navmenu to counter page it redirects me to the auth0's login page. Can you provide more details about how do you enter to the counter page?

I have logged in before then I go to Counter page.

I comment out the call SayHello in OnInitialize and the same issue occurs if I press the button "SayHello".

It is possible to see your configuration on Auth0 because I believe If it runs correctly on your side it can be a misconfiguration on my side.

I believe here is an problem with call the server API from client side.

It's pretty simple, just like this

imagen

An oidc application. All on server side. Client side has nothing to configure since it trusts the cookie server adds.

In your code you do not use Audience and Secret. Is it necessary?

In addition: Thank you for this sample and your support.

I am not sure what Audience means.

You're right,. Yo don't need them. Maybe the error is line 32,

.AddHttpClient("API", client => client.BaseAddress = new Uri("https://localhost:7078/"))

This is the api (aka server) url.

Yes, i did not change your launch settings.

I am not sure what Audience means.

Audience is your server url.

Did you make more than standard configuration on the application page on Auth0 site?

  • callback
  • logout

Yes, allow post redircects, nothing else

It works if the component runs as WebAssembly.

Do you see a possibility it solve the issue with the InteractiveServer?

Yes. I think so. But now it does a http call. I’ll need to modify it a little bit.

Here you go. Now it has mediatr inside all projects. One handler for server without httpclient and another with httpclient for client side. I think is the best approach. In test you can add your own mock implementation.

I believe now we have the correct behaviour 😊