how to set “context.request.query” with password-less login with magic link using management API.
here we are talking about Action’s context.
how to set “context.request.query” with password-less login with magic link using management API.
here we are talking about Action’s context.
Hi @akgupta317,
Thanks for reaching out to the Auth0 Community!
Unfortunately, the context.request.query
is a read-only property and cannot be updated. Could you please clarify what you intend to do here?
The equivalent property in Actions is the event.request.query
property.
I look forward to your reply.
Thanks,
Rueben
Hello guys ,
I also have another solution , and i am just suggesting you hope so it is beneficial for you let see-
To set “context.request.query” with password-less login with magic link using the Auth0 Management API, you can follow these steps:
jsonCopy code
{
"name": "my-passwordless-connection",
"strategy": "email",
"enabled_clients": ["my-client-id"]
}
Replace “my-passwordless-connection” with the name you want to give your connection, “email” with the strategy you want to use (in this case, email), and “my-client-id” with the ID of the client you want to enable for passwordless login.
perlCopy code
{
"connection": "my-passwordless-connection",
"email": "user@example.com",
"send": "link",
"authParams": {
"response_type": "token",
"redirect_uri": "https://my-app.com/callback",
"state": "some-state",
"scope": "openid profile email"
}
}
Replace “my-passwordless-connection” with the name of the passwordless connection you created in step 2, “user@example.com” with the email address of the user you want to send the magic link to, and “https://my-app.com/callback” with the URL of your application’s callback endpoint. The “authParams” object contains the additional parameters that will be included in the authentication request, such as the response type, redirect URI, state, and scope.
Note that you may need to configure your application’s callback endpoint to handle the authentication response and extract the necessary information from the context object. You can find more information on how to do this in the Auth0 documentation. hope so it is useful for you.
thanks @rueben.tiow,
we want to pass some transactional or context-level data to action for that particular login request.
Detailed use-case :
let’s say there is a user as : testUser@123
there is a request to login/Authorize this user with an email link.
now there is some context attached to this request as
var request_Context ={
plan = A,
requested = 123
}
now, we want to pass this login request_context to Auth0 Actions, so that we can use this info
to perform some operations.
please let me know if you need more details.
note: this contextData is not user’s meta data, its data specific to a password-less login request
which we want to persist after successful passwordless magic link login.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
Hi @akgupta317,
Thank you for your response.
You should be able to use an Auth0 Post Login Action to get the Passwordless magic link login’s context request in Actions by calling event.context.request
.
Please let us know if you have any additional questions.
Thanks,
Rueben