Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repeated call of HTML5 app causes "Sorry, a technical error occurred! Please try again later." error #6

Open
gregorwolf opened this issue Aug 3, 2016 · 10 comments
Assignees

Comments

@gregorwolf
Copy link
Contributor

Yesterday I've accessed the alpha test page at:

https://sitregparticipant-s0001142741trial.dispatcher.hanatrial.ondemand.com/

using Firefox without any problems. I was first redirected to:

https://accounts.sap.com/saml2/idp/sso/accounts.sap.com

so I had to authenticate. But today I was taken directly to the app and that resulted in the error "Sorry, a technical error occurred! Please try again later."

technical error occurred

In the details the following is shown:

{
    "requestUri": "/destinations/HANAMDC/com/sap/sapmentors/sitreg/odataparticipant/service.xsodata/$metadata?sap-documentation=heading",
    "statusCode": 200,
    "statusText": "OK",
    "headers": [],
    "body": "Cut away"
}

We must find a way to enforce the re-authentication even if caching of the page was still valid.

@gregorwolf
Copy link
Contributor Author

The same error occurs also in Google Chrome. In the network log we see that the main page was loaded from the cache:

technical error occurred-chrome

@gregorwolf
Copy link
Contributor Author

Seems the change ca06512 had no effect on the behaviour when accessing /

@gregorwolf gregorwolf reopened this Aug 3, 2016
@gregorwolf
Copy link
Contributor Author

OK, I've found the documentation: Authentication with a sample coding. But where should that be integrated? In every XHR call? There are done by the SAPUI5 framework.

@gregorwolf
Copy link
Contributor Author

Repeated test of fix ca06512 in Chrome and Safari on Mac OS worked. But Firefox on Mac and on Android Firefox and Chrome run into the same issue. Now testing on Windows with Edge, Chrome, Firefox and IE 11.

@jpenninkhof
Copy link

Most of SAPs applications just refresh the browser when the SAML token is expired. That forces a re-auth. Otherwise you indeed probably would have to subclass the ODataModel and add a result-check/re-auth/retry to the read method.

@gregorwolf
Copy link
Contributor Author

On Windows 10: Edge, Chrome and IE 11 did no re-authentication. Firefox did.

@gregorwolf
Copy link
Contributor Author

@jpenninkhof Any sample code doing the refresh when the SAML token is expired?

@jpenninkhof
Copy link

@gregorwolf Sorry, I'm afraid I don't have anything I can share atm.

@gregorwolf
Copy link
Contributor Author

By deleting the session cookies using Chrome Dev Tools -> Resources -> Cookies there is a quick way to reproduce the issue. When setting a breakpoint in "this._oModel.attachMetadataFailed(function (oEvent) {" of controller/ErrorHandler.js I can discover that oEvent.mParameters.response.headers["com.sap.cloud.security.login"] has the Value "login-request". So I will use that to trigger window.location.reload();. I think it would make sense if SAP improves the SAP Web IDE templates or the documentation.

@gregorwolf
Copy link
Contributor Author

The immediate problem is fixed. But if we could use an iFrame to do the SAML authentication and then try calling the service again the screen would not refresh completely for the user. But that can be an issue when the user is no longer logged on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants