# Mobile login to seperate API silently

**URL:** <https://community.auth0.com/t/mobile-login-to-seperate-api-silently/87410>\
**Category:** Get Help\
**Tags:** mobile, api, login, auth0\
**Created:** [July 21, 2022, 6:35pm UTC](https://community.auth0.com/t/mobile-login-to-seperate-api-silently/87410 "2022-07-21T18:35:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![diederik](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/diederik/32/33834_2.png) [@diederik](https://community.auth0.com/u/diederik)\
**Post date:** [July 21, 2022, 6:35pm UTC](https://community.auth0.com/t/mobile-login-to-seperate-api-silently/87410/1 "2022-07-21T18:35:26Z")

</div>

Hi.  
We have a native app (on iOS) that already logs in to our existing backend using Auth0 (And the Auth0.swift SDK). The call to WebAuth launces a browser, the user logs in and we get the needed tokens back.

Now we have a new API (that we also control) that is registered to our Auth0 account. The audience value is different than the first API.

How can we get a token that will talk to the new API without showing the user a new login screen?

We have tried calling WebAuth with the new audience (and parameter `["prompt": "none"]`) to a second call to WebAuth, but that just fails with “Login required”. (Infact calling WebAuth on exactly the same audience also returns “Login required” with `["prompt": "none"]` which makes us think that WebAuth has no idea of what active sessions, or credentials are available.)

Any help around this would be appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [July 27, 2022, 1:14am UTC](https://community.auth0.com/t/mobile-login-to-seperate-api-silently/87410/3 "2022-07-27T01:14:50Z")

</div>

Hello there @diederik and welcome to the community!

> [@diederik](#):
>
> How can we get a token that will talk to the new API without showing the user a new login screen?

As far as I’m aware this isn’t possible regardless of platform - If the audience needs to be changed, then users will need to re-auth.

With a native app in general, you should consider looking into using [refresh tokens](https://auth0.com/docs/secure/tokens/refresh-tokens) if you haven’t already. Some more on managing credentials in Auth0.swift here:

> **[GitHub - auth0/Auth0.swift: Auth0 SDK for Apple platforms](https://github.com/auth0/Auth0.swift#credentials-manager-ios--macos--tvos--watchos)**
>
> Auth0 SDK for Apple platforms. Contribute to auth0/Auth0.swift development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![diederik](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/diederik/32/33834_2.png) [@diederik](https://community.auth0.com/u/diederik)\
**Post date:** [July 27, 2022, 6:44am UTC](https://community.auth0.com/t/mobile-login-to-seperate-api-silently/87410/4 "2022-07-27T06:44:26Z")

</div>

OK thanks, we suspected so. We were looking for a `getTokenSilently` for mobile, but it doesn’t seem possible from what we have seen.

We ended up mergeing our [API to a logical one as described here](https://auth0.com/docs/get-started/apis/set-logical-api).

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [August 3, 2022, 11:55pm UTC](https://community.auth0.com/t/mobile-login-to-seperate-api-silently/87410/5 "2022-08-03T23:55:09Z")

</div>

Great! Thanks for following up with the community 🙂

---

<div class="post-metadata">

**Author:** ![ty.frith](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ty.frith/32/58484_2.png) [@ty.frith](https://community.auth0.com/u/ty.frith)\
**Post date:** [August 18, 2022, 11:55pm UTC](https://community.auth0.com/t/mobile-login-to-seperate-api-silently/87410/6 "2022-08-18T23:55:23Z")

</div>

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.
