Fixes Made
1) Removed authorizeUrl local variable and instead used the getAuthorizationURL method straightaway inside the SOP
2) Renamed endSession method to getSessionLogOutURL and used it within the SOP to make it consistent
3) Added finally block for closing connection and stream
4) Added code to set timeouts within connection