IBM Worklight Adapter Invocation is throwing UNRESPONSIVE_HOST error - oauth

I have a very simple Worklight project that has two adapters. The first is talking to LinkedIn OAuth services to return an access token. The second takes the access token and calls LinkedIn's API services. The code works beautifully in project A. Project A is a larger project and includes a bunch of other things. I took the working adapters and copied them into project B. The adapters are word for word the same. The security settings between the projects are identical. Both adapters are deployed and I can verify them on the Worklight Console. However, in project B, when i call the oauth adapter i get the access token just fine, when i turn around and call the api adapter I get an error immediately saying that the host is unresponsive. UNRESPONSE_HOST "The service is currently not available".
Here is the logcat messages:
01-16 15:42:44.298: D/LinkedIn(3101): Request [http://192.168.245.1:10080/LinkedInDevWorks/apps/services/api/LinkedIn/android/query]
01-16 15:42:44.488: E/LinkedIn(3101): [http://192.168.245.1:10080/LinkedInDevWorks/apps/services/api/LinkedIn/android/query] Host is not responsive. Try to manually access the URL through the android emulator browser to verify connectivity.
I'm running out of ideas...
I looked at this article: http://www.ibm.com/developerworks/websphere/techjournal/1212_paris/1212_paris.html on adapter error messages but the settings between the two projects are identical so it's odd that it works on one and not the other.
I am running worklight 6.0

I still haven't found a solution to this problem but I wanted to post the workaround as an answer for others facing a similar problem:
"When i call the second adapter within the success handler from the first adapter or from within the wlCommonInit() method it does NOT throw the UNRESPONSIVE_HOST error."

Related

Network Error on iOS emulator from Capacitor App

I am using Angular Capacitor v3 with axios. Receiving a Network Error when making any request to any external server. This is only occurring while emulating with XCode. The request never reaches the server, just returns immediately with status 0.
I cannot repeat this problem locally on Windows, or published website, or Android Studio emulators, or published to android device.
Not sure if I am missing a permission or configuration, but I have tried adding "Local Network Usage", "Location Always and When In Use" permissions and played around with NSAppTransportSecurity settings to the Info.plist.
I do not believe its an issue with the server since it seems like it never even reaches it. But I have a verified HTTPS certificate, hosted by Azure, with valid CORS rules.
I have also tried HttpClient with Angular, same result.
The error occurs immediately and does not give specific information but here is the message:
{"headers":{"normalizedNames":{},"lazyUpdate":null,"headers":{}},"status":0,"statusText":"Unknown
Error","url":"https://jsonplaceholder.typicode.com/users/1","ok":false,"name":"HttpErrorResponse","message":"Http
failure response for https://jsonplaceholder.typicode.com/users/1: 0
Unknown Error","error":{"isTrusted":true}}
After extensive research and rebuilding from scratch, I found this was a CORS related issue but specific to setup with Azure, which was my hosted server. The confusing part was that even external example calls, such as to "http://jsonplaceholder.typicode.com/users/1" still gave the same error, which wouldn't have CORS issues, as far as I understand. If anyone knows why that happens, please let me know.
This was related to the fact that in ios, the http/https schemes cannot be used, instead it uses capacitor. This scheme is not allowed in Azure App Service CORS settings, unless you allow all, but I could not because I needed to enable Access-Control-Allow-Credentials. So I had to build the CORS configuration with the capacitor scheme allowed in my C# app service code. Removing all settings from CORS in Azure App Service then allowed the settings in my C# code to be applied.
I am just facing same issue
It was working on different domain, no hostname is different and it stopped working.
So it doesn't even make a request to a server.
Also same configuration works on android. just not IOS

What has changed in Microsoft oAuth 2.0 implementation?

I have a web site that has been using Microsoft accounts for authentication for more than three years. It is a Node web app and is using the passport-windowslive package.
Lately, when users return from login.live.com after logging successfully using their Microsoft accounts, one of two types of errors is received, sometimes:
The provided value for the input parameter 'scope' is not valid. The target '«my web site domain»' does not exist.
or:
The provided value for the 'code' value is not valid. The code has expired.
The error is sporadic. I am unable to reproduce it on my development machine.
As the passport-windowslive package was last changed four years ago and my code has not changed for more than two years, the cause looks like it's at the Microsoft end. What has changed?
Update: The problem is getting worse. Previously, the problem could sometimes be overcome by using an incognito browser session or changing the browser. Now it's happening on all browsers. But I am still unable to reproduce the error when running on localhost (with no http).
Microsoft has changed how its applications can be used for oAuth. They must now be managed from Azure instead of apps.dev.microsoft.com or Microsoft Live.
Existing applications configured in apps.dev.microsoft.com will result in:
AADSTS700016: Application with identifier '000000xxxxxxx' was not found in the directory 'aaaaaaaa-bbbb-cccc-ddd-eeeeeeeeeeee'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.
The passport-windowslive module somehow did not bubble up the error response.

Xamarin google play services login setup

I am trying to hook a Xamarin project up to Google Play Services but keep receiving a SIGN_IN_REQUIRED error when calling Connect. I have read a few posts online but cannot determine what actually causes this error message.
I have setup the a game project and also setup an API with oAuth credentials. I have made sure that the same SHA key is being used in the API credentials and in the application while debugging but I am still not making any progress.
I am currently presuming that this is not a coding problem but rather something to do with the setup of the API services etc but have ran out of things to try at this point.
Firstly, to make sure your network connection is normal, you can run this demo in your network environment.developer.xamarin.com/samples/monodroid/google-services/… Donnot forget to change to clientID in string.xaml.Then , open the firebase console, find this app check the clientID if it is same with your code, and check the SHA-1 hash of your signing certificate.

Google Authentication via .NET/OWIN: Access_Denied

When I try to call Google to authenticate, I get an access_denied response.
I have the Google+ API enabled
This code was working yesterday and I do not see anything that would cause it to break now.
This code works in one environment (dev) but fails in another (test).
I updated our test environment to have the same code (copied from dev) and it fails there.
This seems to be server related, but I can't figure out why.
Google's configuration has all the appropriate response and redirect uris (I just changed the subdomain).
Is there anyway I can find out WHY access is denied?
One possible cause for getting a generic access denied error when interacting with Google is their block on "less secure apps": https://support.google.com/accounts/answer/6010255?hl=en
It generally returns an error that is assumed by most apps and sites as an incorrect password, even if your password is correct. If you are using different Google accounts between dev and test, and one is configured differently than the other, this might be a possible reason.

Connect from MVC app to WebAPI using app pool account

I'm certain I've done this a dozen times before, and I can't think what's causing this to fail now, but, I have an MVC web app with its app pool running as a domain account. It connects to a WebAPI app on the same domain which has Windows auth enabled.
I'd like to be able to read the MVC app pool account name using controller.User.Identity.Name on the WebAPI side, but it's coming back empty. I've tried just about everything, including explicitly setting the MVC app to "connect as specific user".
The MVC app is using HttpClient to connect to the API. I've tried passing an HttpClientHandler with UseDefaultCredentials set to true, but that had no effect.
Connecting to the WebAPI methods from my local machine correctly identifies my domain account. Is there something obvious I'm missing?
This was fixed by adding the BackConnectionHostNames key mentioned here:
https://stackoverflow.com/a/10311823/2179408
It wasn't necessary for me to make the legacyImpersonationPolicy and alwaysFlowImpersonationPolicy aspnet.config changes though.
The 401 responses I was receiving threw me off and led me to believe it was an IIS authentication issue.

Resources