Can I use Identity Platform REST API from server for mfa enrollment?
Such as https://identitytoolkit.googleapis.com/v2/accounts/mfaEnrollment:start.
Now I have an error:
Caused by: com.google.api.client.http.HttpResponseException: 400 Bad Request
POST https://oauth2.googleapis.com/token
{"error":"invalid_scope","error_description":"Invalid OAuth scope or ID token audience provided."}
Hello,
Based on these documentations [1][2], it's possible to use identity platform for mfa enrollment.
The error that you are experiencing is related to the method usage which you require to provide a valid OAuth token & scopes. In the documentations that I shared, you can "Try it!" the both methods before implementation.
[1] https://cloud.google.com/identity-platform/docs/reference/rest/v2/accounts.mfaEnrollment/finalize
[2] https://cloud.google.com/identity-platform/docs/reference/rest/v2/accounts.mfaEnrollment/start