What is the options(client_id,secret) to send to make an api call, in action after post login (onExecutePostLogin)?

Thanks for your answer and the explanation for the event.secrets.
I will try to be more clear of what i am trying to achieve.

I am using already machine to machine api for backend in nestJs and spa application for frontend. I am able to call from my frontend a protected url of the backend (nestJs).

My goal now is when the user sign up first time. In the action in postLogin, i want to send the userId generated from auth0 to to my api in backend which will add this user in my own database.
So my objective, is to call an api from auth0 to my nest js backend which is for example the following one.
This is the api that i expose in my backend, my frontend is able to call this api, but i need to call it from auth0 during the sing up, to send him the userId.
@UseGuards(AuthGuard(‘jwt’))
@Post(‘addiuser’)
async insertUserId(
@Body(‘userId’) userId: string,
) {
// code which add here this id to my database
}
1)I read the example How can I use the Management API in Actions? but it is to use ManagementClient to assign the roles right. Can i use the managementClient to call my external api (/adduser)?

2)I was thinking that this tutorial is what i am trying to do but on this tutorial i don’t see where you are adding the client_id, client_secret or the domain to generate a token access which i should attach to the api (/adduser) that i am going to call right ?

3)Or should i proceed from the example which is here ?

I was trying the third, please let me know if i am on the wrong way ?
So i want to call from auth0 during the sing up, in post login, a endpoint that i created in my backend. To be able to call this endpoint i would need to attach the baerer token right ?

1 Like