For partners that build or integrate commercially available applications and service solutions with the Oracle Cloud Platform
For partners that provide implementation or managed services around Oracle Cloud Applications
Hi,
I am creating a login page which calls a POST REST endpoint. I have create a type from the response when the login is successful, I receive a lot of data back about the user along with a token. However, if the authentication is not successful the response has completely different variables. Currently on my action for a button I have the call REST endpoint linked to the responseType of a call that is successful. However, if the login is not successful then those values aren't available to this responseType as they are stored in a different type.
Am I missing something obvious here?
Comment
Can you define a new type manually with the structure of the returned value when the REST call fails?
Then base a variable on this new type.
Then in your action chain in the Call REST action you will have an option to specify a flow when the call is not successful - and there you can assign the value in a fail state to the new variable.
Be the first to rate this
|
Sign in to rate this
Thanks for the reply, I've been going back to this but no luck.
When the REST call fails, how do I get the values of the REST call that failed back? If the "responseType" of the REST call is created using the successful REST login call, then during the FAIL flow, I have no way to retrieve the failed values as they are different fields than the ones defined in the responeType for the successful login. In VBCS when assiging variables, on the left side I can just see the results that correspond to the succesful login.
Be the first to rate this
|
Sign in to rate this
My guess would be that if the service returns two different formats then you shouldn't specify a responseType - and then just assign the result of the REST call to an object with the right structure.
Be the first to rate this
|
Sign in to rate this
Ok, thanks.
This is a JD Edwards tokenrequest response, so the success repsonse will be something like:
Whereas a unsuccesfull response will be:
{
"type": "HTTP://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
"status": 403,
"title": "Forbidden",
"detail": "{\"message\":\"Authorization Failure: Incorrect User ID or Password.\",\"exception\":\"E1LoginException\",\"timeStamp\":\"2019-10-15T15:18:36.608-0600\"}"
}
I am having a real hard time getting this working. The only way I can succesfully get the values is using a responseType, but then that only works for success. I am new to VBCS so must be doing something wrong. I tried to assign to my "success" type variable upon success in the action flow, and the same for the fail, but it doesnt seem to map the variables doing it this way?
Be the first to rate this
|
Sign in to rate this
ok so in this case, if we keep the success flow going into the strongly typed variable, on the failure flow of the action chain - can you access the status and detail object by referring to them with an EL such as:
$chain.results.callRestEndpoint1.status
and $chain.results.callRestEndpoint1.detail
Be the first to rate this
|
Sign in to rate this
I will give it a shot and report back, thanks.
Also, I have also defined the type/variables at the application level, in my action flow I am assigning values to the application variables. However, in my flow pages when I try to output an application variable its always blank. Ive tried reviewing the documents, but is there a trick to accessing or assigning application variables? Or is the proper way to just use page variables and pass things as needed?
Be the first to rate this
|
Sign in to rate this
The question is at what point are you assigning a value to this application flow variable?
Are you doing this in the vbEnter event of your page?
Be the first to rate this
|
Sign in to rate this
Be the first to rate this
|
Sign in to rate this
Check in the browser console that your login action actually gets to the step of assigning the variable a value - the log should also allow you to see the value that is assigned to the variable.
Be the first to rate this
|
Sign in to rate this
Be the first to rate this
|
Sign in to rate this