-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to use Auth0 in app extensions #184
Comments
This is not something we support and is not in our plans, I have not looked at it in great detail so do not know what is possible. However, if you wish to fork the repo and try out some ideas, I would be interested to see the results. |
Closing, inactivity. |
Just to chime in here, we too are currently integrating auth0 into a notification extension. We get warning:
on both Auth0 and SimpleKeychain libs. Our use case is: notification extension needs to access API in background, almost certainly, we need to refresh access token as part of accessing private API. The funny thing is, we are doing this currently (sharing credentials using shared keychain and SimpleKeychain to share refresh token from main app) and things are working great, but all guidance we have had in the past is that apple rejects apps for using libraries with warnings such as this. It's a shame because I know other swift dependencies are able to support extensions, (I think we can use |
@mrrhysbutler it's not a focus for us. However, if you get it working please raise a PR be happy to review. |
@mrrhysbutler I'm not sure if this will help, but to workaround this issue, I ended up just using the old Lock.swift API client ( |
Thanks @caitlin615 for the suggestion, and @cocojoe for the feedback. |
Hi, I understand the issue is closed, but it seems that this approach might work to allow Auth0 to be used as a Pod in app extensions. Anywhere UIApplication.shared is used, we may be able to use this instead:
Of course, that means that some items that depend on UIApplication.shared returning something won't work, since it returns |
@caitlin615 and all, we revisited this and got an implementation in the feature/extensions-support branch. It doesn't support WebAuth, so it can only be used as an API Client + Credentials manager. Can you try it out and see if it works for you? |
@Widcket This looks quite promising. Apologies for dumb question - Is there a way I can integrate this and get the WebAuth working in my main target while allowing the credentials manager to work in the extensions? |
@xparabolax yes, you can use the credentials manager in the extensions while using WebAuth in the app. |
@Widcket I have in my Podfile these lines:
When I |
@xparabolax I went with a runtime check instead of a flag. Can you give it a try please? |
@Widcket That did it! It works perfectly for me. Thank you so much! |
This is now out in the 1.23.0 release. |
In Apple's Developer Docs,
UIApplication.shared
isn't available to app extensions: https://developer.apple.com/library/content/documentation/General/Conceptual/ExtensibilityPG/ExtensionOverview.html#//apple_ref/doc/uid/TP40014214-CH2-SW6The Auth0 library accesses this here:
Auth0.swift/Auth0/ControllerModalPresenter.swift
Line 28 in 4c60b8a
Can you find a way to make your library usable in app extensions?
The text was updated successfully, but these errors were encountered: