Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
627 views
in Technique[技术] by (71.8m points)

authentication - Is it possible to restrict PHP page to certain devices?

I've build a PHP web application which I only want my wife and I to have access too. Adding password protection adds an unnecessary user step - is it possible to restrict the page to certain devices (e.g. our iPhones, iPad and MacBook) regardless of wifi / 3G network etc.

I don't think PHP can determine MAC address - so is there a suitable method other than password protection?

Thanks,

Mike

EDIT

Some further info to help clarify:

The server is running on Debian/Linux (The RaspBMC off-shoot of Raspbian to be precise).

I need access from anywhere, home and out and about.

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

There are actually ways to get the user's MAC address, but these can be spoofed anyway.

I would recommend making a cookie, for you and her, and requiring data from it (like a key) as authentication, with it updating every now an then.

Updating it would protect against people that had manged to get a copy of the cookie (somehow...) from using it forever.

It could also be something like sending every request with a 'automated' username/password/auth key, into the post or get variable, to be checked by the server. Also has downfalls, as someone could be sniffing your packets. But at that point, you probably have bigger problems.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...