How to let user sign in through a browser - ios

I use OctoKit library to access API of github , but how can I implement a custom URL scheme in iOS (I don't know how to let user sign in through a browser )?

This document describes how to implement custom URL schemes.

Related

Twitter API: How Do I Create a Protocol Only Callback URL?

In Twitter's Developer Documentation we can read the following:
Mobile apps with app-specific protocols must use just the protocol
Example:
You want to use example://authorize as your callback URL
Add this to both your Twitter app dashboard and your call to oauth/request_token: example://
However; in the Developer's Dashboard I am not able to enter a protocol only URL, or any URL beginning with other than http or https.
My reason for wanting a protocol only URL is so that I can use in an iOS app that uses OAuthSwift to access web APIs.
Any ideas anybody?
I haven't found the answer to the original question but I do have an excellent work around. So, for anyone else who might land here:
The web app at https://oauthswift.herokuapp.com/callback
will perform redirections. If you access that web site with the url https://oauthswift.herokuapp.com/callback/target then it will redirect to oauth-swift://oauth-callback/target.
So:
In the Twitter Dashboard enter https://oauthswift.herokuapp.com/callback/SomeName for your app's callback URL
Register oauth-swift as a URL scheme in your iOS app's URL Types
In your iOS app, use https://oauthswift.herokuapp.com/callback/SomeName as the callback URL for the OAuth authorization request.
Voila. Twitter will redirect to https://oauthswift.herokuapp.com/callback/SomeName which will in turn redirect to oauth-swift://oauth-callback/SomeName, allowing your iOS app to regain control of the flow.
If you find any of this confusing then this might help: http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html

How to handle the redirected uri in ios for google sign in programmatically?

I am currently doing a task in which i need to implement google sign in programmatically. I am passing the client id in the custom uri scheme and present it through svc. When i do authorization, google is not returning to my app instead it opening google.co.in page. I can get the uri in the open url method of app delegate but i don't know how to handle it and open my app instead of google.co.in page. Can someone help me to resolve it programmatically? since i should not use any predefined libraries here. Thanks in advance!
Are you using Google SDK ? If so then you should've created an App on console.firebase.com , get you redirect URI from there and add it in you info.plist. It's not returning because it's not finding the redirect URI.

AsanaConnect oAuth Redirect URL with custom scheme

The account settings page for registering an app accepts just valid http:// url schemes. We would require a custom url scheme in order to redirect back to our iOS app. Is there currently a way to provide a custom url scheme or if not, would it be possible to allow custom URL schemes from your side?
(I work at Asana.) We agree those would be useful. There is currently no way to use non-http schemes but we will look into adding them soon. Stay tuned!

Custom URL for my extension

Can I have a special URL like chrome://myurl or anything similar to that( like about:mypage in firefox.) for my google chrome extension.
Basically I am trying to authenticate the user using oAuth. The oAuth provider requires a callback url.
Extension resources can be accessed by the url
chrome-extension://<extension-id>/<resource>
The Extension ID can be found on the extensions page in Chrome. Within an extension, it can be obtained programatically using the chrome.extension.getURL method. For example:
console.log(chrome.extension.getURL('/'));
// "chrome-extension://jcjnnblkpjakjflggajpdalncflgbkgg/"

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

Resources