Enable MFA
curl --request POST \
--url https://identity.sandbox.lerian.net/v1/users/{id}/mfa/enable \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mfaType": "app",
"recoveryCode": "<string>",
"secret": "JBSWY3DPEHPK3PXP"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://identity.sandbox.lerian.net/v1/users/{id}/mfa/enable"
payload := strings.NewReader("{\n \"mfaType\": \"app\",\n \"recoveryCode\": \"<string>\",\n \"secret\": \"JBSWY3DPEHPK3PXP\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mfaType: 'app', recoveryCode: '<string>', secret: 'JBSWY3DPEHPK3PXP'})
};
fetch('https://identity.sandbox.lerian.net/v1/users/{id}/mfa/enable', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://identity.sandbox.lerian.net/v1/users/{id}/mfa/enable"
payload = {
"mfaType": "app",
"recoveryCode": "<string>",
"secret": "JBSWY3DPEHPK3PXP"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}Enable MFA
Turns a VERIFIED channel on. From here the account is protected: the next sign-in asks for the second factor.
Third and last of the enrollment calls. Before doing this, make sure the recovery codes have been stored.
On success the response has no body (204).
Failures:
400— the channel was never verified.404— no such user.503 IDE-0066— the identity provider is unavailable (unreachable, too slow to answer, or failing). Nothing about the request was wrong; retry it later.
POST
/
v1
/
users
/
{id}
/
mfa
/
enable
Enable MFA
curl --request POST \
--url https://identity.sandbox.lerian.net/v1/users/{id}/mfa/enable \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"mfaType": "app",
"recoveryCode": "<string>",
"secret": "JBSWY3DPEHPK3PXP"
}
'package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://identity.sandbox.lerian.net/v1/users/{id}/mfa/enable"
payload := strings.NewReader("{\n \"mfaType\": \"app\",\n \"recoveryCode\": \"<string>\",\n \"secret\": \"JBSWY3DPEHPK3PXP\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({mfaType: 'app', recoveryCode: '<string>', secret: 'JBSWY3DPEHPK3PXP'})
};
fetch('https://identity.sandbox.lerian.net/v1/users/{id}/mfa/enable', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://identity.sandbox.lerian.net/v1/users/{id}/mfa/enable"
payload = {
"mfaType": "app",
"recoveryCode": "<string>",
"secret": "JBSWY3DPEHPK3PXP"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example",
"upstream": {
"code": "E4001",
"message": "account not found at provider"
}
}{
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}{
"code": "<string>",
"entityType": "<string>",
"err": "<unknown>",
"message": "<string>",
"title": "<string>"
}Authorizations
JWT bearer token issued by the identity provider.
Path Parameters
User ID.
Example:
"00000000-0000-0000-0000-000000000000"
Body
application/json
Response
No Content
Was this page helpful?

