cancel
Showing results for 
Search instead for 
Did you mean: 

Run UI5 app with managed approuter in BAS

WouterLemaire
Active Contributor
4,669

Hi all,

I followed this blog post https://blogs.sap.com/2020/09/11/building-a-central-launchpad-using-sap-cloud-platform-launchpad-ser... of murali.shanmugham to create a UI5 app using the managed approuter. All works fine when deployed. But when I try to run directly from BAS, I'm getting the following message.

Any idea how to solve this?

Thank you all in advance!

Kr, Wouter

yuval_morad
Advisor
Advisor

Please create a service instance of xsuaa "application" plan from BAS via command "create service instance".

In run configuration connect to this instance.

Make sure you have one process running in local run for the project using port 6004

Contact me if it is not working

WouterLemaire
Active Contributor
0 Kudos

Thank you yuval.morad . But this is already the case. Tried creating a new service (just to be sure) ended up with the same result...

WouterLemaire
Active Contributor
0 Kudos

I get the following messages in BAS after opening my app

#2.0#2020 09 16 18:18:10:539#+00:00#INFO#/Auth/OAuth2#####d3873947-2800-444f-9ffc-3d4a3181d2c0####cbj-SrgxBS7Uj5HNnwOY6_M1JM02BipV######d3873947-2800-444f-9ffc-3d4a3181d2c0#PLAIN##req.url: /bewlExampleApp/index.html# #2.0#2020 09 16 18:18:10:541#+00:00#INFO#/Auth/OAuth2#####d3873947-2800-444f-9ffc-3d4a3181d2c0####cbj-SrgxBS7Uj5HNnwOY6_M1JM02BipV######d3873947-2800-444f-9ffc-3d4a3181d2c0#PLAIN##sending page with client-side redirect to https://2d32c6fatrial.authentication.eu10.hana.ondemand.com/oauth/authorize?response_type=code&clien... #2.0#2020 09 16 18:18:10:543#+00:00#INFO#/Auth/OAuth2#####d3873947-2800-444f-9ffc-3d4a3181d2c0####cbj-SrgxBS7Uj5HNnwOY6_M1JM02BipV######d3873947-2800-444f-9ffc-3d4a3181d2c0#PLAIN##x-forwarded-path header: undefined#
js2
Product and Topic Expert
Product and Topic Expert
0 Kudos

c3d1947136cd4c748a7aa794001af496 did you end up resolving this? I am finding that I also get this oauth redirect error when I run the app deployed in cloud foundry via the url.

If I run the app from within the Launchpad it works fine.

If I run the app via the url retreived from ``cf html5-list -u -d` then I get the same error you show here.

View Entire Topic
yuval_morad
Advisor
Advisor

I suspect you root package.json lacksdevDependency "@sap/approuter": "8.1.x", "@sap/html5-repo-mock": "1.5.x",

Or

The env file attached to launch.json used by your local run, does not include the right xsuaa

I hope you can access these links

Try this one I recorded 3 months ago E2E flow using central App Router
https://sap-my.sharepoint.com/:v:/p/yuval_morad/EaR7wmPE_xFDscHXBaBiXSEBxuVfgtICtOYdY5ZVbsqgsA?e=B6N...

This is local run

https://sap-my.sharepoint.com/:v:/p/yuval_morad/Efeu7z-wN2pNrA7u6b2hwsYBLvJMAIvwda65vHLcmYS0vw?e=d76...

WouterLemaire
Active Contributor
0 Kudos

Thanks yuval.morad , that works! Looks like the additional parameters when creating the xsuaa instance in BAS are very important 🙂 I created my service manually... Thanks again!

maissa93
Participant
0 Kudos

This is the exact issue that I am facing right now in spite of the proposed solutions here.

The issue is in run configuration is does not connect any instance nor datasource.

Can you share the .env file please where xsuaa is configured? I might have the wrong syntax.

roylerner3
Explorer
0 Kudos

Hi,

Does it work in trial account ?

I cant find neither the html5 tab under my workspace nor the given entitlements.

I deployed the newly built MTA file, I got some new service instances, but w/o routes/urls

"cf html5" command comes out empty from business studio.

Thanks.

yuval_morad
Advisor
Advisor
0 Kudos

The HTML5 menu in trial will probably come in Q1 this year.

Until then you can execute the from the terminal in BAS the following:

cf html5-list -di <destination service instance name in the mta> -u

Check my migration blog
https://blogs.sap.com/2021/01/14/migrating-sap-fiori-applications-from-neo-to-cloud-foundry-using-sa...

and formal documentation

https://help.sap.com/viewer/584e0bcbfd4a4aff91c815cefa0bce2d/Cloud/en-US/83b0fb23e37d456caad1ad0448e...

0 Kudos

Hello yuval.morad ,

How do we check if "The env file attached to launch.json used by your local run, does not include the right xsuaa" ? I am facing the same problem as listed above, I've added redirect_uris as well, but still I am getting the error. Also I did not define the run configuration for the destination but I have default-env.json file that has configuration for the destination.

yuval_morad
Advisor
Advisor
0 Kudos

You would need to describe your flow accurately:

1. Local run of Fiori app? for CF/ABAP? using managed approuter or standalone approuter

2. Which local run is used html5-repo-mock?

3. Reuse library consumption? from the same MTA or not

4. Data source consumption? from a destination of BE app in CF

5. Role test yes/not

In general this requirement of binding to XSUAA is not required anymore for local run using latest version in dev-dependency "@sap/html5-repo-mock": "2.0.x"