Twitter Oauth callback to www subdomain within same domain - asp.net-mvc

I'm using ASP.NET MVC 3 and TweetSharp. I'm open authorization dialog with window.open(), at the end of auth program in this window tries to access to main window through window.opener.
In my application callback set to http://www.domain.com and when i'm open site from that url everything works fine, but if use just domain.com i get an error something like "Acces is denided because of different domains" when window.opener is accessed.
I have tried to set callbackUrl when app auth dialog opens, but this has no effect. Also changing callback url to http://domain.com give same result.
Only way to solve this is to use UrlRewrite to always redirect on www.domain.com. Or i'm missing something and there is another way?
Thanks.

Log in to your Twitter Dev Account (dev.twitter.com), select the appropriate Twitter Application, go to the tab "#Anywhere domains" and add www.domain.com as authorized...
works for me

i did not work with tweeter but i work with facebook the same problem are there that is why i put the canvas url there with my domain url try to put your call back url as your domain url
or try some thing like this in java script :
var url = window.location;
url = url.toString();
url = url.replace(/www.domain.com/,"domain.dev.domain.com")
window.location = url;

Related

Correct Format of Harvest API OAuth2 Redirect URL in iOS Application

What is the correct format for a redirect URL when authenticating with OAuth2 and the Harvest API from an iOS application?
oauth.com states that a redirect URL for a native application can look like myapp://callback. Problem is, Harvest doesn't accept such a redirect URL. It seems to require prefixing it with http/https, which causes problems when redirecting back to the iOS application at the end of the authentication flow. I don't seem to find anything relevant in the Harvest API documentation.
I have added a URL Type in Xcode where I set the Identifier value to com.example.myapp and the URL Schemes value to MyApp. No matter what redirect URL I specify (given the format mentioned above) in Harvest the authentication flow always complains that Safari cannot open the page because the server cannot be found. I am able to open the app manually with the appname:// URL from the
It sounds like you're looking for the URL to use regarding redirection from a web call. I'm not certain on oath2, but on SAML it is something like
https://where you are signing in/SSOpage?RelayState=https://where you are going
I hope this helps get you to your answer.
If anyone else has this issue, the identifier and URL Schemes should not be com.example.myapp and MyApp, respectively. You only need to set the URL Scheme to com.example.myapp

What redirect URL to use when logging in with GitHUB with OAuth2?

I'm new in ios sdk and English. Therefore, sorry for my Eng.
I try to do authentication through github using OAuthSwift.
In the registration of the application (https://github.com/settings/apps), there is need a redirect URL. In the tutorial from raywenderlich.com was an example, they did authorization through Google. They wrote a unique domain in this line that does not work: com.raywenderlich.Incognito. And in Info.plist, we added a Scheme URL with com.raywenderlich.Incognito, so that (as I understood it) when we go to this address after authentication, we’ve got into our application. But if you try to add in the application settings (https://github.com/settings/apps) the Redirect URL: something like com.raywenderlich.Incognito, will generate an error, because github wants the URL to have to be valid. If we put the Valid URL there, then when we will be redirected to this address, we will simply go to it and will not return to the application.
I would be grateful for any help.
Sorry for my English.
Redirect url in OAuth is the url that the authentication provider navigates to when authentication is successful.
For mobile apps it is the link that launches the app (a sort of deep linking)
For websites it is the website home screen

Instagram Issue of Redirect URI

I am using https://github.com/crino/instagram-ios-sdk for instagram integration.
I am using previously redirect_uri "igc7d978e285674a7f9a409d3520f4c780://authorize" it is working fine. I need to update some thing and redirect_uri float an error
I add https:// in redirect_uri and update that in app it give error in safari "Safari cannot open the page". What could be the issue
url scheme is defined in plist.
Implementation needs to be changed. Use UIWebView to achieve the functionality.
The error in above is that it adds https: or http to redirect uri , which is not the right format for redirection in iOS URL scheme that why it say Page not found.

How to navigate to a web page from within a flutter app? (OAuth)

I am trying to build a Flutter app that uses OAuth to connect to a user's account on another website. This requires navigating to the site's OAuth page where the user can enter their credentials, and then parsing the code that's sent back to the app when the user returns.
So my questions are:
How can I navigate to the OAuth web page?
I have figured out that I can navigate to an internal route like this:
Navigator.of(context).pushNamed('/some_page');
But what if I want to go to an external page like https://coolsite.com/oauth/authorize?
How can I do this (a) by opening the URL in the local web browser, and (b) with an in-app web view?
What URL should I redirect the user to after authenticating so that they go back to the app, and how do I parse the response?
It seems there are 2 ways:
(a) Let the user be redirected to a blank page with the authorization code in the URL and title of the page. If this method - how do I parse the page or URL?
(b) Redirect the user to some kind of scheme, like my-dart-app://coolsite-oauth?code=xyz. If this method - how do I register the scheme, and would cool site-OAuth map to a route that I specify when calling new MaterialApp, or somewhere else? And how would I parse the query param?
You can trigger a navigation using the activity service:
import 'package:flutter/services.dart';
void launchUrl(String url) {
Intent intent = new Intent()
..action = 'android.intent.action.VIEW'
..url = url;
activity.startActivity(intent);
}
There isn't currently a way to receive a navigation in Flutter, but that's something we'd like to add. I've created this issue to track this feature request: https://github.com/flutter/flutter/issues/357

Problems with redirection while implementing oAuth2 for blackberry using webworks

I am trying to implement a SoundCloud app for blackberry phones using webworks frame work.
I am using OAuth2 scheme for authorization. So far I am able to display the SoundCloud log-in page from where the user can allow the app. But the problem occurs during the redirect which is essentially done by SoundCloud. The redirect page which is being pointed to by the call back URI is residing in my device, but after the user approves the app I get a page saying "something went wrong". However when I try to bounce the redirect from a third server, it just works fine. In this case I specify the callback URL pointing to a page on a website which only forwards the request to the page which is residing on my device. But the problem is that I do not want to use this "bounce server"
Could you please look into the code and advise if I am doing something wrong.
/**
* Authenticates the app against soundcloud
* This javascript method is called in the index.htm of my application.
*/
authenticate : function(){
var url = "https://soundcloud.com/connect?" + "scope=nonexpiring&client_id=MY_CLIENT_ID&" +
"response_type=code&redirect_uri=local:///testpage.htm";
window.location = url;
;
/************************************/
testpage.htm only displays "hello sound cloud".
Any help in this regard shall be highly appreciated.
The value for the redirect_uri parameter must match the value of the "Redirect URI" on the app edit page.
Example: https://img.skitch.com/20120411-q6yqada29tcadnep15jc6q75a1.jpg
IHTH
Hannes
The problem is the triple slash part in your redirect_uri. Although, it is a valid URI according to the RFC 3986, the Ruby URI library behaves a bit strange when parsing such values. We're working on a fix.
In the meantime, could you try to use local:/testpage.htm?

Resources