I am currently authorizing specific APIs on my browser based application using getAccessTokenSilently
from @auth0/auth0-vue
. I don’t see any similar option for the Swift library. Is there a similar concept? How do I get access tokens for specific APIs or scopes? How do I manage these?
tyf
June 22, 2022, 11:29pm
3
Hey @jgleason !
There isn’t an equivalent of getAccessTokenSilently
just given the nature of mobile vs SPA:
opened 09:35AM - 25 May 22 UTC
closed 10:28PM - 26 May 22 UTC
feature request
<!--
❗ For general support or usage questions, use the Auth0 Community forums o… r raise a support ticket.
By submitting an issue to this repository, you agree to the terms within the Auth0 Code of Conduct: https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md.
-->
- [x] I have looked into the [README](https://github.com/auth0/Auth0.swift#readme) and have not found a suitable solution or answer
- [x] I have looked into the [API documentation](https://auth0.github.io/Auth0.swift/) and have not found a suitable solution or answer
- [x] I have searched the [issues](https://github.com/auth0/Auth0.swift/issues) and have not found a suitable solution or answer
- [x] I have searched the [Auth0 Community](https://community.auth0.com/tags/c/sdks/5/swift) forums and have not found a suitable solution or answer
<!--
❗ All the above items are required. Issues with an incomplete or missing checklist will be unceremoniously closed.
-->
### 💥 Describe the problem you'd like to have solved
I have an iOS App that needs to access two different APIs, and each API has it's own audience. I want to be able to to ask for an access token with different audience without asking user for his password a second time.
<!--
A clear and concise description of what the problem is. For example, I'm always frustrated when...
-->
### ✨ Describe the ideal solution
Have the equivalent of `getAccessTokenSilentrly` of the Auth0 React SDK.
<!--
A clear and concise description of what you want to happen.
-->
### 🩹 Alternatives and current workarounds
The only workaround I found is by calling the login() function twice, with the same email, password but different audience.
The issue with that is I can't use Auht0 Credentials manager anymore, I need to manage the login state and access tokens.
<!--
A clear and concise description of any alternatives you've considered or any workarounds that are currently in place.
-->
### 📌 Additional context
<!--
Add any other context or screenshots about the feature request here.
-->
Have you had a chance to take a look at our Swift quickstart /sample app ? You’ll noticed that WebAuth
is used for authentication - You can find the full reference documentation on it here .
Hope this helps!
I will take a look again at the sample app. So if I need multiple access tokens per audience and scope sets on the native how do I handle that?
tyf
Closed
July 12, 2022, 2:58pm
5
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.