Change parameter in URL with CryptoAPI or other solution?

Right now I am making an example application which should change the ID to something garbled so that an end user cannot tamper the ID and see data that is not intended to be seen. I am developing on OutSystems 11 and this is a Reactive application. I am trying to do this with CryptoAPI but I seem to be struggling a bit. I know one of the solutions is to add a GUID to the existing entity but I need to make two proof of concepts :)


To give a example of what it should be:

https://domain.com/URLHiding/Detail?Id=4 must change to something like https://domain.com/URLHiding/Detail?Id=432573459359 (unique ID that cannot be guessed by end user)


Is there anyone who could be of any help or provide an example on how to do this? I've looked on the forum and found a lot of articles about this, but at the moment it is hard for me to get it to work.


Basicly the application has a list and when you click on one of the list items you are being navigated to a detail page. I've attached my OML so you can see what I am trying to do.


1. Create AES_Encrypt and I guess I need to put the ID in the Plaintext (Since I want to ID to be unreadable)? I do not know how to get the Key in there since I am getting the error "Invalid Data Type 'Binary Data' data type required instead of 'Text'." I know that is thrown because I have an output parameter in CreateKey that is of type Text, but when I Change it to Binary Data the flow in CreateKey is not working anymore. Not sure how I should fix that.


2. When I have the ID encrypted I should be moving it over to the detail page. What is the best way to do this? Maybe create a Client Action that has a destination in the end where I can store the encrypted ID? On the detail page I should be able to decrypt it (maybe in a OnInitialize but not sure if that is the correct way?)?


I hope my problem is clear and somebody can point me in the good direction. A working example would also be nice to have a look at. Thanks in advance!



Solution

Hi Bart,

I have updated you oml.

Please have look hope this will help you.

Id is not integer but it is encrypt form.


Regards

Rahul Sahu

Solution

Rahul Sahu wrote:

Hi Bart,

I have updated you oml.

Please have look hope this will help you.

Id is not integer but it is encrypt form.


Regards

Rahul Sahu

 Hi Rahul Sahu,


Thanks! This is exactly what I am looking for.

 

Welcome @Bart,

Glad to help you.


Cheers