Update Main.cpp

add authentication and authorization