You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to pass additional parameters to Auth0 during passwordless authentication so that these parameters can be used to drive logic in a Post Login Action.
I have found that setting a parameter via parameters() fails for passwordless authentication (Auth0.authentication().startPasswordless()). However, if I instead call Auth0.webAuth() with a passwordless connection (like sms) and set parameters() for this approach then this does pass through additional parameters that are available in a Post Login Action via event.request.query.
I realise that these are separate calls (Auth0.authentication().startPasswordless() uses the /passwordless/start endpoint to call an API whilst Auth0.webAuth() opens a web view for the /authorize endpoint with the additional parameters appended to it).
Perhaps I am missing something. Can additional parameters be set for passwordless authentication (via Auth0.authentication().startPasswordless()) and if so how are these available in a Post Login Action?
If not:
what is the intent of the parameters() available to Auth0.authentication().startPasswordless()?
is passing additional parameters to Auth0 during passwordless authentication on the roadmap?
Reproduction
Call passwordless authentication with Auth0.authentication().startPasswordless():
Auth0
.authentication()
.startPasswordless(phoneNumber: mobileNumber, connection: "sms")
.parameters(["message": "hello world"])
.start { result in
switch result {
case .success:
// Success
case .failure(let error):
// Failure
}
}
This call fails with the following error message:
Failed with: the following properties are not allowed: message
Next, call Auth0.webAuth() with a passwordless connection:
Auth0
.webAuth()
.connection("sms")
.audience("https://api.example.com/")
.scope("openid profile email")
.useEphemeralSession()
.parameters(["login_hint": mobileNumber])
.parameters(["message": "hello world"])
.start { result in
switch result {
case .success(let credentials):
// Success
case .failure(let error):
// Failure
}
}
This call succeeds and the message parameter is visible in a Post Login Action via event.request.query.
Additional context
No response
Auth0.swift version
2.5.0
Platform
iOS
Platform version(s)
17.0
Xcode version
15.0.1
Package manager
Swift Package Manager
The text was updated successfully, but these errors were encountered:
For the parameters to be picked up by the PostLogin action, these should be sent when calling Auth0.webAuth() instead of startPasswordless(phoneNumber:connection:).
Closing, as I believe the above answers your question. If you have any further questions, please reach out via Slack, as I see you're an Auth0 employee.
Checklist
Description
I am trying to pass additional parameters to Auth0 during passwordless authentication so that these parameters can be used to drive logic in a Post Login Action.
I have found that setting a parameter via
parameters()
fails for passwordless authentication (Auth0.authentication().startPasswordless()
). However, if I instead callAuth0.webAuth()
with a passwordless connection (likesms
) and setparameters()
for this approach then this does pass through additional parameters that are available in a Post Login Action viaevent.request.query
.I realise that these are separate calls (
Auth0.authentication().startPasswordless()
uses the/passwordless/start
endpoint to call an API whilstAuth0.webAuth()
opens a web view for the/authorize
endpoint with the additional parameters appended to it).Perhaps I am missing something. Can additional parameters be set for passwordless authentication (via
Auth0.authentication().startPasswordless()
) and if so how are these available in a Post Login Action?If not:
parameters()
available toAuth0.authentication().startPasswordless()
?Reproduction
Call passwordless authentication with
Auth0.authentication().startPasswordless()
:This call fails with the following error message:
Failed with: the following properties are not allowed: message
Next, call
Auth0.webAuth()
with a passwordless connection:This call succeeds and the
message
parameter is visible in a Post Login Action viaevent.request.query
.Additional context
No response
Auth0.swift version
2.5.0
Platform
iOS
Platform version(s)
17.0
Xcode version
15.0.1
Package manager
Swift Package Manager
The text was updated successfully, but these errors were encountered: