Twitter callback url Error - twitter

I am trying to setup OAUTH for my twitter related app .I am using a callback url which gets the access token inside my application .
However I am getting the following error :-
onReceivedError -2 http://www.someurl.com/auth/twitter/callback?&oauth_token=ajGYfwX5YauPcHnUIQCjFf1pFBGmhBEhAxFv8Ej6Ns&oauth_verifier=VBWZ5HaDMwGzrzbGOUlEQhUbZmKoLzWXVRqSxBUZI The URL could not be found.
My Browser shows page not responding .
My CallBack Url =http://www.someurl.com/auth/twitter/callback .
I am using onNewIntent for receving the intent from my browser .
public void onNewIntent(Intent intent)
{
super.onNewIntent(intent);
System.out.println("Here ");
Uri uri = intent.getData();
String oauthToken = uri.getQueryParameter("oauth_token");
String oauthVerifier = uri.getQueryParameter("oauth_verifier");
}
Manifest File :-
<activity android:name=".Testing" android:launchMode="singleTask">>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="x-oauthflow-twitter" android:host="callback" />
</intent-filter>
</activity>

The call back is a bit odd, it's actually in the format scheme://host.
So for your app, based on the manifest file, it would be "x-oauthflow-twitter://callback". This means that you'll have to specify that url as the callback url in your code too.

Related

Is it possible to link from 2 different domains to the same app using dynamic links?

I have 2 domains and one single app but would link from both domains to app-pages via Deep-Links.
Is it possible to link from e. g. both static.domain.com and content.domain.com into the same app with dynamic links?
Thanks in advance :)
Sure, you could add many domain as many as you want.
Just add your domains inside manifest.
<data android:host="static.domain.com" android:scheme="http"/>
<data android:host="static.domain.com" android:scheme="https"/>
<data android:host="content.domain.com" android:scheme="http"/>
<data android:host="content.domain.com" android:scheme="https"/>
So, the code look like this:
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="static.domain.com" android:scheme="http"/>
<data android:host="static.domain.com" android:scheme="https"/>
<data android:host="content.domain.com" android:scheme="http"/>
<data android:host="content.domain.com" android:scheme="https"/>
</intent-filter>
Do not forget to verify your domains by adding assetlinks.json inside .well-known folder. Ensure that is accessible using https://static.domain.com/.wll-known/assetlinks.json and https://content.domain.com.com/.wll-known/assetlinks.json. Should using https for verifying your domain.
Cheers

Cordova ios App: how to open app when xml link are clicked in Safari

With Android, the application opens when links xml, rss or atom are selected in Safari.
To do this, I use the Cordovan-webintent plugin, and I add following case in AndroidManifest.xml:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="http" />
<data android:mimeType="text/xml" />
<data android:mimeType="application/rss+xml" />
<data android:mimeType="application/atom+xml" />
<data android:mimeType="application/xml" />
</intent-filter>
And I get the file in the application with the Cordovan-webintent plugin
I can not find a solution to do the same with IOS, ie open a file with the app when the "mine type" is met.
URL scheme does not seem to fit the need.

SAML SSO failure - "Reason: Destination is invalid."

I'm using SSOCircle and have my metadata imported and a valid redirect request executing. I am not getting any errors in my AuthnRequest (I was, but I corrected that). However, when I execute the redirect I receive the error:
Reason: Destination is invalid.
Not sure what I am missing.
My Authn looks like this:
<samlp:AuthnRequest ID="_ID_" Version="2.0" IssueInstant="2016-02-25T16:20:04.869Z" Destination="http://localhost:9000/saml/service" ForceAuthn="false" IsPassive="false" ProtocolBinding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST" AssertionConsumerServiceURL="http://localhost:9000/saml/assert" xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol">
<saml:Issuer xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">MY_ISSUER_ID</saml:Issuer>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<Reference URI="_ID_">
<Transforms>
<Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#">
<InclusiveNamespaces PrefixList="#default samlp saml ds xs xsi" xmlns="http://www.w3.org/2001/10/xml-exc-c14n#" />
</Transform>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<DigestValue>_DIGEST_</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue>_SIGNATURE_VALUE_</SignatureValue>
<KeyInfo>
<X509Data>
<X509Certificate>_CERTIFICATE_STRING_</X509Certificate>
</X509Data>
</KeyInfo>
</Signature>
<samlp:NameIDPolicy Format="urn:oasis:names:tc:SAML:2.0:nameid-format:persistent" SPNameQualifier="MY_ISSUER_ID" AllowCreate="true" />
<samlp:RequestedAuthnContext Comparison="exact">
<saml:AuthnContextClassRef xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport</saml:AuthnContextClassRef>
</samlp:RequestedAuthnContext>
</samlp:AuthnRequest>
I am sending the redirect to:
https://idp.ssocircle.com:443/sso/SSORedirect/metaAlias/ssocircle
The library I am using is from ComponentPro (which I am pretty happy with).
The problem is that your Destination attribute in the AuthnRequest is set to http://localhost:9000/saml/service and your are actually sending it to https://idp.ssocircle.com:443/sso/SSORedirect/metaAlias/ssocircle.
The destination attribute must be the same as the actual destination.

Associate URL with Windows Phone 8.1 application

is it possible to associate specific URL with Windows Phone 8.1 application?
When there is a request to open URL in format e.g. http://myservice.mydomain.com?Params... from e-mail or page in browser, my application will process an URL.
On Android it is possible in manifest with intent-filter for some activity:
...
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:host="myservice.mydomain.com" android:scheme="http" />
</intent-filter>
...
Thanks.
You can make an URI association with a custom URI schema, like "myapp:"
Read more here: URI Associations

Deep Linking Android first opens the launcher activity (not the deeply linked activity )

Deep Linking Android first opens the launcher activity (not the deeply linked activity ) then the deeply linked activity as declared in Manifest file.I have followed all the steps mentioned here .
viz. Manifest contains
<activity
android:name="com.example.android.GizmosActivity"
android:label="#string/title_gizmos" >
<intent-filter android:label="#string/filter_title_viewgizmos">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with "http://www.example.com/gizmos” -->
<data android:scheme="http"
android:host="www.example.com"
android:pathPrefix="/gizmos" />
<!-- note that the leading "/" is required for pathPrefix-->
<!-- Accepts URIs that begin with "example://gizmos”
<data android:scheme="example"
android:host="gizmos" />
-->
</intent-filter>
</activity>
and Deeply Linked activity contains
#Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Intent intent = getIntent();
String action = intent.getAction();
Uri data = intent.getData();
}
and some other activity specific code.
I had this same problem and in my case it was simply a copy and pasting issue. make sure your deep links intent filters ONLY exist under the right activity in the manifest. if you have 2 identical filters under 2 different activities, it will open the first one (logically your main activity would be your first one)
Just remove android:label="#string/filter_title_viewgizmos" from intent filter. Your code will start working.
Thanks.

Resources