NielsNumbers's avatar

Use Vimeo only for authenticated users?

Hey, I uploaded a video to Vimeo and checked " hide video from Vimeo". I also whitelisted my domain. The video can now only be watched if it is embed on my website.

However, how I can make sure that only authorized users may watch it? Currently, anyone who visits my website and knows the url of my private video, could watch it, simply by using the browser-inspector tool and copy/paste an iframe with the url. Is there a way to make sure a user is authenticated before showing the video?

0 likes
8 replies
tisuchi's avatar

@elenktik

If I unederstand you properly, you simply use auth in your view file to check whether the user is authenticated or not. Only that time, you show the vimeo video.

For example-

@auth
    // The user is authenticated...
    // Show the vimeo video
@endauth

@guest
    // The user is not authenticated...
    // Show whatever you want to show
@endguest

Read more: https://laravel.com/docs/5.7/blade#if-statements

NielsNumbers's avatar

Yes of course, thats how to set it up. My issue is, that anyone who has the vimeo url can still watch it if he manually inserts an iframe with inspection tool.

Deekshith's avatar

@elenktik i am also facing same issue. if you have found the solution can you please share?

NielsNumbers's avatar

@deekshith I contacted Vimeo and it seems that there is no solution to this problem. You can try it on laracast as well. If you logout but copy an iframe with the inspection tool, then you can watch the videos here without beeing a member.

1 like
CarlEOgden's avatar

Hi

As I am new to all this I might be wrong, but, why not try this:

@if (Auth::user())
	@auth
    		// The user is authenticated...
    		// Show the vimeo video
	@endauth
@else
	@guest
    		// The user is not authenticated...
    		// Show whatever you want to show
	@endguest
@endif

Regards Carl

NielsNumbers's avatar

Hi, yeah thats how you authenticate in Laravel, this is the same that tisuchi suggested. My question was, if there is some authentication between Laravel and Vimeo, because if someone got the URL you can't prevent them from watching the video. I was asking for another layer of security.

Deekshith's avatar

@elenktik Actually the problem is if i am a paid user i can able to view the video and someone inspects the web page and copy the iframe and he can play same iframe in our website home page as vimeo domain whitelisting only works for parent domain. i have one solution for this providing temporary url for vimeo video url just like creating temporary url in server end that is using laravel?

Please or to participate in this conversation.