Auth0 user metadata bad audience when using swift

So I’m trying to use Auth0 to secure my API

My login flow is as follows on button press

                            .scope("openid profile offline_access read:current_user read: current_user_metadata update:current_user_metadata")
                            .start { result in
                                switch result {
                                case .success(let credentials):
                                    Task {
                                        await landingViewModel.saveCredentials(credentials: credentials)
                                        await rootViewModel.checkAuthStatus()
                                case .failure(let error):
                                    print("Failed with: \(error)")

When I add audience(AUTH0_DOMAIN/api/v2

I can use the user metadata correctly, but I then can’t use my API because it has a different audience.

I’m unable to figure out how to get a new token without using webAuth all over again

Hi @techadmin2,

Welcome to the Auth0 Community!

If you need to access your API, I recommend passing in the audience of the API that you are looking to access.

Just to clarify, is there a specific reason for using a different audience than the one intended for the API?


I need to also use the user meta data which is a different audience than the one used for my API