completed implementation of authorisation challenge for communication with web api