Redirect user using NetworkExtension framework - ios

I have an application that uses NEFilterProvider API to filter urls (allows/blocks browsing). ControlProvider and DataProvider extensions created.
So for this point I can block/allow certain urls.
I wonder if there is a way to implement redirection to custom url using NetworkExtension ?

According to NEFilterDataProvider:
If the Filter Data Provider chooses to block the web page, then a special “block” page is displayed in the WebKit browser object informing the user that their attempt to access the content was blocked. The Filter Data Provider can choose to add a link to this block page, giving the user the option of requesting access to the content.
There is no other way to redirect user besides a link from "block" page. Neither url nor page content could be changed using NEFilterProvider API. The best solution for redirection would be a VPN connection. You can find example here.

Related

Typo3: FE Login with POST Request to external app server

I recently started getting into Typo3 but now I have to implement something for work and I have no clue where to start.
The requirements:
I have to add a separate page that can only be accessed by frontend
users. (so far no problem)
These frontend users should be able to login with the same password
as they got for their iOS app. (uh-oh)
The separate page should display data from the app. (less of an uh-oh
but connected to the previous point)
After talking to the developer of the app, he made a specific POST request that can be used for the webpage. I am also getting a json-file with the required data that I need to display upon successful login.
My question lies with the login. How do I go about implementing this? I use the extension felogin to provide the login form on the page.
The POST request is looking sort of like this:
https://domain.at/api/queryMediaItems. It needs user and password, declared as user and pwd. In the body there should be a json object with the language, e.g.:
{"language":"de-at"}
You need to implement a SSO (SingleSignOn) as your users need to identify against the iOS-app.
This might give you a concept.
You also can look inside the code of some extension

Using generic (custom) connections with Auth0

I am trying to use Auth0 to log in to several social media sites at once in a single page app. I have added a generic OAuth2 server to my account for Tumblr, using the instructions here: https://auth0.com/docs/connections/social/oauth2. I have verified that the server was correctly added, and the JSON-P response for my client application is populated with the correct info based on what I added.
My question is, how can I use the JS popup widget to login to this server? I essentially have a couple social logins that are built-in to Auth0 that are working by passing (e.g.) connections: ['twitter'] to the .show() function, and a couple social logins that are not built-in, that I can't seem to wire in correctly to work similarly to the built-in social logins.
In other words, when I use connections: ['twitter'], the popup correctly shows the "Login with Twitter" button. However, when I use connections: ['tumblr'] (where 'tumblr' is the name of the custom connection I made), the popup doesn't show any buttons or even the username/password fields to login to my custom connection. I'm clearly not understanding how this popup is supposed to work with custom connections, so any advice would be much appreciated.
It turns out that Tumblr uses oauth1, not oauth2. So, I was on the right track, but I was just using the wrong eaxmple page. Here is the example page for oauth1 connections: https://auth0.com/docs/oauth1.
You can also then add customizations to the login screen as described here: https://auth0.com/docs/libraries/lock/ui-customization. That will allow you to do what I was looking for in my original question.
Custom OAuth2 connections won't show up on Lock (the UI widget), you have to use your own UI. The library you are looking for is auth0.js (UI-less library) that will handle the auth process for you.
This is likely changing in the next release of Lock.

Multiple OAuth redirect URIs for Dropbox Datastore API?

I wonder how the OAuth 2.0 redirect URI works, the App console over at Dropbox allows me to add multiple URL;s so what I really wonder is do I need to add every URL that needs access to the API?
A small exemple:
At the page index.html the user is prompt to connect to Dropbox, when connected the user is sent to app.html there the app it self is. What should then be the redirect URI, the index.html, the app.html or both?
You don't have to register each URL from which you access the API, just the one that the user is redirected back to after authorizing the app. Generally you'll only have one of these in production, but you might also use a localhost URL during development.

Is there a nice way in trigger.io to handle OAuth?

In my case I would have a re-direct URL with a custom url schema like
myapp://oauth
So first I would forward to my oauth login url and then I need to register an event handler for the location change to check if it matches my re-direct url.
Yes, we have an example of how to handle oauth2
Using forge.tabs.openWithOptions, you can specify a url to open in a child browser, and a pattern to monitor for to trigger the child browser to close and return the parameters. So you can specify a redirect_url that will match that pattern.
Update: if you want to use Facebook for authentication we've now integrated the native Facebook SDK so you can do authentication with the forge.facebook module:
http://docs.trigger.io/en/v1.4/modules/facebook.html#modules-facebook

Link on Facebook with custom prefix/protocol (like myapp://blahblah)

I added to my iOS application option to detect and response to custom URL schemes to launch application ( http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html ).
Link is working perfectly on different sites (using href), but I'm having problem with Facebook. If I'm trying to post link (using Graph API) which looks like:
myapp://blabla
Facebook return error:
The url you supplied is invalid
And for feed with link return
link URL is not properly formatted.
I can't just post url as a message because it's not being detected as a URL and appear like text only.
Is there any way to post to Facebook wall with custom links?
Edit:
I have an idea, but I don't know if it gonna work. Putting
myapp://blabla directly into address field in mobile browser is launching application so probably accessing an webpage (like http://www.mywebpage/myapp) with only redirection to
myapp://blabla gonna work too, but is Facebook gonna accept that link?
I think your suggestion in the edit is the correct method, and should work. However applications like spotify seem to use an intersticial page which fires the "app link" with javascript, the advantage to this approach is that you can use that page to "sell" the app to users who don't have it and also provide lovely open graph tags for people who want to share it.

Resources