Jump to content

Authorisation


lewisstevens1

Recommended Posts

Hi i was just wondering how you would create something like Google's webmaster Tools website validation (where you download a file, upload to the url then validate it).

 

I was looking at oAuth but i wasn't sure how to build it into the script - how does it get / generate the authentication token / key?.

 

Would be great if someone could help.

 

Many thanks

Lewis Stevens

Link to comment
Share on other sites

If you're talking about how google has you upload a file of a specific name to your website in order to validate your ownership, then that is relatively easy.

 

a) You generate a unique token and use it as part of the file name. uniqid can generate the token, md5 or sha1 can be used to hash it, making it more user friendly. You could use any other method you want too.

B) Tell the end user what the token is and what to do, ie 'Create a file named "verify_XXXXX.html" in the root' where XXXXX is the token.

c) Have your server make a http request to their site for the file. curl can be used to make this easy. If the file exists then consider them validated.

Edited by kicken
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.