How to get JWT for Integration Test?

Hi,

I m currently using social authentication (which is working) for my website Asp.Net Core with Angular.
I would like to be able to test my webserver using xUnit Test. For this, I need a bearer.

So to get the JWT i need to call : Authentication API Explorer
But to call it, first i Need to call: Authentication API Explorer

but when I call:
https://MYDOMAIN.auth0.com/authorize?scope=openid&response_type=code&client_id=CLIENTID

I have a web page as result not a json.

What is your easiest solution to get a new JWT from a userId ?

Thank you

You can get an access_token using the Client Credentials Grant flow:
https://auth0.com/docs/api/authentication#client-credentials

This will not present a user interface.

The issue however is that the sub claim of the token (and therefore the “user id” you will retrieve inside your ASP.NET application) will not be a user, but an application. This may be acceptable under certain circumstances - for example if you do not care that the sub of the token is an actual user.

So I guess my follow up question would be, do you use the user id inside your application?