Happy to help!
The method you’re using, Auth0\SDK\Auth0->login()
does not take into account parameters, you’re correct. But you can build the link yourself and include those parameters if you want. The method is here:
public function getSamlpMetadataLink(
?string $clientId = null,
): string {
[$clientId] = Toolkit::filter([$clientId])->string()->trim();
/** @var string $clientId */
[$clientId] = Toolkit::filter([
[$clientId, $this->getConfiguration()->getClientId()],
])->array()->first(ConfigurationException::requiresClientId());
return sprintf(
'%s/samlp/metadata/%s',
$this->getConfiguration()->formatDomain(),
$clientId,
);
}
public function getWsfedLink(
?string $clientId = null,
?array $params = null,
): string {
… and an example of how that method is used is here:
if (! isUserAuthenticated()) {
// Generate and store a state value.
$transient_store = new CookieStore();
$state_handler = new TransientStoreHandler($transient_store);
$state_value = $state_handler->issue(Auth0::TRANSIENT_STATE_KEY);
$auth0_api = new Authentication(
getenv('AUTH0_DOMAIN'),
getenv('AUTH0_CLIENT_ID')
);
// Generate the authorize URL.
$authorize_url = $auth0_api->get_authorize_link(
// Response requested by the application.
'code',
// Callback URL to respond to.
getenv('AUTH0_REDIRECT_URI'),
// Connection to use, null for all.
null,
// State value to send with the request.
$state_value,
In your error handling, you can build out the authorize link if those error params are present.