Forum Discussion

riaanh's avatar
riaanh
Creator II
6 years ago

Cannot get OAuthServer discovery document

Hi team

Like the rest of the world we have published our Aras now on an external URL. My Aras seems to be working well, apart from one error, when I try to run the checkout manager,

Aras.IOME.CheckoutManager cm = new Aras.IOME.CheckoutManager(fileItem);

I get the following error:

-<af:exception message =" Cannot get OAuthServer discovery document. " type =" System.AggregateException " >

-<af:innerException message =" Cannot get OAuthServer discovery document from 'plm.cxxx.com/.../' url. " type =" System.InvalidOperationException " >
-<af:innerException message =" An error occurred while sending the request. " type =" System.Net.Http.HttpRequestException " >
-<af:innerException message =" Unable to connect to the remote server " type =" System.Net.WebException " >
 <af:innerException message =" A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 
The system is working 100% if I run the same function with the internal url.
I double checked my OAuth.config file, and there is no obvious errors. We did move to https but it has a certificate and no errors in the browser.....
What did I miss?
Regards
Riaan

8 Replies

  • When requesting an OAuth token using the implicit grant flow (response_type=token) with a client_id configured to request WWW-Authenticate challenges (like openshift-challenging-client), these are the possible server responses from /oauth/authorize, and how they should be handled.

  • Hi Riaan,

    The OAuthServer discovery document is actually stored inside of the /Innovator/Server/ folder. You can look at the second section of this blog post for some more details. In short, it serves as a way to point an app to the correct OAuth URL based only on the normal Innovator server URL.

    Could you try pinging this URL from your local machine to see if you get an error? You can get it to by adding /Server/OAuthServerDiscovery.aspx to the URL you usually use to connect to your instance. 

    Chris


    Christopher Gillis

    Aras Labs Software Engineer

    • riaanh's avatar
      riaanh
      Creator II

      Thanks Christopher, your advice put me in the right track. Between out IT department and myself we sorted it out.

      For other people with the same limited ICT skills as myself, my IT guy explained it as such: 

      (It should probably be classified as a "Lie-to-children" explanation, but it makes sense to me)

      When you run a C# method on the server, Aras is following the URL. With the new URL it was going out of the server and trying to find it on the internet, our firewall blocked the script from coming into the server again. So he defined the URL on the local host file......now everything is working.

      Regards

      Riaan

      • angela's avatar
        angela
        Catalyst II

        Hi, 

        I face a similar issue when using attachPhysicalFile for uploading a file to the server. I use a REST call to upload text content that than shall be converted to a file by Method. The Method works fine when directly started within Innovator. But when I call it from REST I get the exact same error. Do you have more information about "how to define URL on a local host file"? Would be happy about any additional help :)

  • Hi Riaan,

    after 2 years I faced the exact error message again! I have a second Innovator instance that is accessible via an external URL. 

    Two years ago the error message described in my post was caused by wrong SSL settings. But this time I faced the same firewall problem and I was able to resolve it with your "hosts" tip! I still want our IT to verify the solution to be save. But until then: Many thanks for asking and answering this question two years ago!!!

    • riaanh's avatar
      riaanh
      Creator II

      It is a pleasure Angela, I am trying to stay in the habit of doing that. I wish everybody would close off their questions with the answer.