public function Authentication::login_with_default_directory in Auth0 Single Sign On 8.2
Makes a call to the `oauth/token` endpoint with `password` grant type
@link https://auth0.com/docs/api-auth/grant/password
Parameters
array $options Options for this grant.:
- options.username Username or email of the user logging in; required.
- options.password Password of the user logging in; required.
- options.scope Access token scope requested.
- options.audience API audience identifier for access token.
string|null $ip_address Pass in an IP address to set an Auth0-Forwarded-For header.:
Return value
mixed
Throws
ApiException If username or password is missing.
File
- vendor/
auth0/ auth0-php/ src/ API/ Authentication.php, line 450
Class
- Authentication
- Class Authentication
Namespace
Auth0\SDK\APICode
public function login_with_default_directory(array $options, $ip_address = null) {
if (!isset($options['username'])) {
throw new ApiException('username is mandatory');
}
if (!isset($options['password'])) {
throw new ApiException('password is mandatory');
}
if (!empty($ip_address)) {
$options['auth0_forwarded_for'] = $ip_address;
}
$options['grant_type'] = 'password';
return $this
->oauth_token($options);
}