Hi Ivy Team I have the following setup: A process is started to display a dialog. In the dialog (..../MyDialog.xhtml) a redirect to another site is executed and the site calls again .../MyDialog.xhtml?myParam=xyz myParam should be read in a script box - usually one would use ... FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get("myParam") but looks like this doesn't work. Importantly I can not use the start/param mapping feature. So is there another way to read the parameter or the request path ? Thanks & Regards John asked 22.02.2019 at 05:42 John Moser |
answered 22.02.2019 at 10:10 Reguel Werme... ♦♦ Unfortunately that doesn't work (for my setup). Solution (seems more like a hack to me - therefore any corrections are welcome):
(25.02.2019 at 04:02)
John Moser
Yep sounds definitively like a hack. Maybe you can share why and how you trigger the redirect in first place and look for an alternative solution in this area.
(25.02.2019 at 09:42)
Reguel Werme... ♦♦
We are trying to implement a OAuth flow. Usually this is implemented by using redirects in a browser. Also OAuth is adding parameters to the URI. So this means we need to read them from there. Further the OAuth system will check the redirect URI, that means we can't jump from URI_1 and then use redirect URI_2. The implementation currently is as follows ( https://jira.axonivy.com/confluence/display/~jmo/OAuth+flow+with+Ivy ) : - there is a "Display Accounts" process which displays a dialog (xhtml) - in the "xhtml" there are 2 calls which run asynchronously ...
(26.02.2019 at 08:09)
John Moser
... a) <f:viewaction> to calculate the URI and read request params if available b) <p:remotecommand> to load the data to be displayed, which also triggers the OAuth flow if necessary -> sub process getAccountData() - as you can see in the gfx, "Redirect to OAuth" redirects to the OAuth uri to start the OAuth flow - after the OAuth flow the "xhtml" is loaded again but the process starts right with getAccountData() ... i guess due to loading of "xhtml" => imho - in a "user dialog method start", one should be able to map the request params like in a "request start"
(26.02.2019 at 08:09)
John Moser
|
Hey John, thanks for your sample flow. I think the issues with it arise as you check the OAuth token within an existing UserDialog. And you can't safely redirect to another page within that JSF Dialog without loosing context information. To work around for that problem: I think it would be easier to work with extra screens/Ui Dialogs in case the OAuth token is not present/valid. You could even stick to your current solution and leave the already running dialog with an ErrorEnd event, which you catch outside the dialog and if necessary delegate the request to the OAuth form UI. A solution very similar to my proposal can be found in the official 'ConnectivityDemos', which are shipped as Designer sample. See Import -> Axon.ivy > Samples > ConnectivityDemos : answered 01.03.2019 at 09:41 Reguel Werme... ♦♦ |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 22.02.2019 at 05:42
Seen: 2,138 times
Last updated: 04.03.2019 at 09:51