Hi,
Here I am generating One link and passed that link in the Email for user, but when user clicked link from email, receives the Error :
"The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters."
Used Crypto API
To generate a link
Site.GeneralFormLink+EncodeUrl(AES_Encrypt.Ciphertext)+EncodeUrl("&IsForm2=false&Key=")+EncodeUrl( BinaryToBase64.Base64)
Generated Link:
Hi @Harbor V,
You have encoded the url parameter with EncodeUrl() function before generating the link so when you are trying to decrypt that Base64 parameter then first you need to decode that encoded parameter and make it exactly what it was before using the EncodeUrl().
Thank you so much for Guiding me
Expression which used to Generate a Link that only I Changed
Site.GeneralFormLink+EncodeUrl(AES_Encrypt.Ciphertext)+"&IsForm2=false&Key="+EncodeUrl( BinaryToBase64.Base64)
and it works
Thank You
Hi @Harbor V
I think your requirement is when a person send a mail than in this mail you have a button like this:
1. you want to encrypted button link via crypto API and navigated to screen ??
If this is your requirement so its is not possible because when we navigate email to screen than you have only pass Screen URL with some some Value like this
before encryption URL( You Need To Naviagte):
https://personal-bedrfblj.outsystemscloud.com/Home/Home?id=id
After Encryption URL
"wurhuefjkdjfdfhuefhuwehyfuehfcjvdcdvcncbvdfhnjxndughvncmnvcjvmcnbvnfcjmvncvncmvncvnc"
So its is not Valid link to Navigate Same screen and also you Can't decrypt this url or value outside outsystesm so email Via Encryption and description is not possible
You can used Crypto Api Inside the Outsystems application for encryption and description
Thanks
Md Mansur
Hi @Md Mansur ,
I think you got him wrong. He is not encrypting whole URL, he is just encoding the parameter. Check the second image attached with the question, where he has shown the generated link, the link has a domain and a screen name.
Hi @Harbor V .If you want to use the output of the CryptoAPI as an URL Parameter, you will need to convert it from Base64 into Base64URL.https://base64.guru/standards/base64url
TL;DR; You will need to:
Then, when receiving the value, you will need to convert it back from Base64URL into Base64:
Here's an example on how to properly calculate the padding necessary
Hope this helps,