0

1 year agoby Vinod malviya

what is Signed URLs

hii Sir,

i heard that laravel version 5.6 include a new route Signed URLs, i read official documentation but unable to understand as i checked you have use this method when you send me confirmation email when i register on this site , can you explain me how it works with a real world example thanks.

88

Sarthak Shrivastava replied 1 year ago

0

Hey, as you know signed URL is a way to protect your website from unauthorized access for your URL by using a key or token.

It is very easy to implement.

Fir while creating URL you need to create a hashed or encrypted token, and then just add that token on the query itself.

So when even any person use your URL to do something on website (just like you used URL to validate your email), firstly on laravel I need to check that does the token from query string is a valid one or not.

If signature or key or token is valid then proceed to other task otherwise truncate the process and return error.

There are many options to for signature to validate. 1. You can store key into database and upon validation delete it. 2. You can save it on cache or session 3. You can create key and secret combination to validate query key

So there are many options.

Thanks

Ask Question
Most Visited
Categories