C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementClient(
token: "<token>"
);
await client.Guardian.Policies.SetAsync(
new List<MfaPolicyEnum>(){
MfaPolicyEnum.AllApplications,
}
);
}
}package example
import (
context "context"
management "github.com/auth0/go-auth0/management/management"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := []management.MfaPolicyEnum{
management.MfaPolicyEnumAllApplications,
}
client.Guardian.Policies.Set(
context.TODO(),
request,
)
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.MfaPolicyEnum;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();
client.guardian().policies().set(
Arrays.asList(MfaPolicyEnum.ALL_APPLICATIONS)
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Types\MfaPolicyEnum;
$client = new Management(
token: '<token>',
);
$client->guardian->policies->set(
[
MfaPolicyEnum::AllApplications->value,
],
);from auth0.management import ManagementClient
client = ManagementClient(
token="<token>",
)
client.guardian.policies.set(
request=[
"all-applications"
],
)require "auth0"
client = Auth0::Management.new(token: "<token>")
client.guardian.policies.set(request: ["all-applications"])import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.guardian.policies.set([
"all-applications",
]);
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.guardian.policies.set([
"all-applications",
]);
}
main();curl --request PUT \
--url https://{tenantDomain}/api/v2/guardian/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '[]'[]Update multi-factor authentication policies
Set multi-factor authentication (MFA) policies for your tenant.
The following policies are supported:
all-applicationspolicy prompts with MFA for all logins.confidence-scorepolicy prompts with MFA only for low confidence logins.
Note: The confidence-score policy is part of the Adaptive MFA feature. Adaptive MFA requires an add-on for the Enterprise plan; review Auth0 Pricing for more details.
PUT
https://{tenantDomain}/api/v2
/
guardian
/
policies
C#
using Auth0.ManagementApi;
using System.Threading.Tasks;
using System.Collections.Generic;
public partial class Examples
{
public async Task Example() {
var client = new ManagementClient(
token: "<token>"
);
await client.Guardian.Policies.SetAsync(
new List<MfaPolicyEnum>(){
MfaPolicyEnum.AllApplications,
}
);
}
}package example
import (
context "context"
management "github.com/auth0/go-auth0/management/management"
client "github.com/auth0/go-auth0/management/management/client"
option "github.com/auth0/go-auth0/management/management/option"
)
func do() {
client := client.NewClient(
option.WithToken(
"<token>",
),
)
request := []management.MfaPolicyEnum{
management.MfaPolicyEnumAllApplications,
}
client.Guardian.Policies.Set(
context.TODO(),
request,
)
}package com.example.usage;
import com.auth0.client.mgmt.ManagementApi;
import com.auth0.client.mgmt.types.MfaPolicyEnum;
import java.util.Arrays;
public class Example {
public static void main(String[] args) {
ManagementApi client = ManagementApi
.builder()
.token("<token>")
.build();
client.guardian().policies().set(
Arrays.asList(MfaPolicyEnum.ALL_APPLICATIONS)
);
}
}<?php
namespace Example;
use Auth0\SDK\API\Management\Management;
use Auth0\SDK\API\Management\Types\MfaPolicyEnum;
$client = new Management(
token: '<token>',
);
$client->guardian->policies->set(
[
MfaPolicyEnum::AllApplications->value,
],
);from auth0.management import ManagementClient
client = ManagementClient(
token="<token>",
)
client.guardian.policies.set(
request=[
"all-applications"
],
)require "auth0"
client = Auth0::Management.new(token: "<token>")
client.guardian.policies.set(request: ["all-applications"])import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.guardian.policies.set([
"all-applications",
]);
}
main();import { ManagementClient } from "auth0";
async function main() {
const client = new ManagementClient({
token: "<token>",
});
await client.guardian.policies.set([
"all-applications",
]);
}
main();curl --request PUT \
--url https://{tenantDomain}/api/v2/guardian/policies \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '[]'[]Authorizations
bearerAuthoAuth2ClientCredentials
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/jsonapplication/x-www-form-urlencoded
The MFA policy
Available options:
all-applications, confidence-score Response
Policies updated
The MFA policy
Available options:
all-applications, confidence-score ⌘I