add authentication logic
Merge pull request #2 from modernlegend/authentication

add authentication logic