Support the ongoing development of Laravel.io →
Authentication Requests Session
Last updated 2 years ago.
0

onilicious said:

If you only wanted to protect your routes, you can use the auth.basic filter instead. It's implemented using the HTTP Basic Auth as well.

Check out this link

http://laravel.com/docs/security#http-basic-authentication

I've already tried this approach and unfortunately it needs eloquent/database structure and fetches 'username' from model. I do not use SQL in my project, so I don't have any models to auth against : ).

I'm not sure about this part, but it seems that you can only have one user and one password if you're using the built in filter.

Nope, it uses your Users (or any other provided in Auth.php file) model.

Furthermore, using .htpasswd is going to be rather painful (and it might not work) because .htpasswd works together with .htaccess and they're usually created to protect directories instead of routes.

Yeah, I've suspected it will be more than hard to implement this strategy... But I'm sure it can be done, just need an idea how to approach this. Any help appreciated!

Last updated 2 years ago.
0

Crap! I was late by a few seconds. I went to delete my reply.

I just went to read the source code myself and found out that you really need a model as well.

You might want to check this out

http://www.htaccesstools.com/

They have some handy generators as well. A quick google on htaccess and htpasswd might help.

Update

You might want to give the sqlite driver a try. SQLite database are file-based and doesn't require any installation. With SQLite, you can pretty much achieve your original goal.

Last updated 2 years ago.
0

onilicious said:

Crap! I was late by a few seconds. I went to delete my reply.

I just went to read the source code myself and found out that you really need a model as well.

You might want to check this out

http://www.htaccesstools.com/

They have some handy generators as well. A quick google on htaccess and htpasswd might help.

Update

You might want to give the sqlite driver a try. SQLite database are file-based and doesn't require any installation. With SQLite, you can pretty much achieve your original goal.

Yeah, I know all about SQLite and such things - 6 years in PHP programming and counting : ). I've really tried almost everything from Google before I've posted this topic to forum. Unfortunatelly I can't use any SQL database in my project (strange-corporation-bull***t-ways-of-do-things).

I guess I'll end up with crafting new ServiceProvider, which will use Illuminate/FileSystem to read file and auth against it in custom filter. Or anyone have another idea?

Last updated 2 years ago.
0

My apologies, didn't really meant it that way (sqlite stuff)

I've always hated the way corporation think that they know everything (at least the ones that I've encountered).

Yeah, you probably might want to create a new filter to catch the routes that you want to protected and compare that against the highly encrypted plain text password file (i'm being super sarcastic, yes!)

Sorry mate, can't really help!

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.