First of all, there is a previous closed unaswered question here How to update user metadata from iOS SDK? My question is the same but i can add more details.
If I implement the native login using the SDK in this way:
Auth0
.authentication()
.login(
usernameOrEmail: userNameOrEmail,
password: password,
realm: "Username-Password-Authentication",
scope: "openid profile offline_access read:current_user update:current_user_metadata")
.start { result in
Then I can’t update the metadata with this:
Auth0
.users(token: accessToken)
.patch(userInfo.sub,
userMetadata: metadata)
.start { result in
So I decided to download and try the preconfigured sample app for my account and it works updating the metadata but only whith web login, the sample app performs this:
Auth0
.webAuth()
.scope("openid profile offline_access read:current_user update:current_user_metadata")
.audience("https://" + clientInfo.domain + "/api/v2/")
.start {
and it gets a valid token for update the metadata in the way I tryed, but if I change the sample app code by hardcoding my login and using the SDK login it doesn’t get a valid access token for update the metadata.
This is very frustrating as I followed precisely the documentation. You can’t update users metadata if you login with the SDK it only works with webAuth login, you don’t specify this anywhere, you must add a table of available features under each available method or combination of methods or you have a bug that doesn’t look to be the case.
Anyway, great product, congrats.