I'm trying to refresh an OAuth token using Lync UCWA, following the examples here, https://msdn.microsoft.com/en-us/library/office/dn356686.aspx#sectionSection3
The example in their docs uses grant_type urn:microsoft.rtc:anonmeeting, but I am using a grant_type=password. My client is successfully authenticating against the /WebTicket/oauthtoken endpoint at first and I receive the access_token just fine.
After a few hours, I need to refresh the OAuth token by posting to /WebTicket/oauthtoken again with the parameters of:
grant_type=password
username=$my_username
password=$my_password
ms_rtc_renew=$access_token (cwt=AA....)
That is returning a status 400 though, with an error: invalid_request and a comment in the headers "No valid security token". The value I'm putting into ms_rtc_renew is the same value I'm using in all of my headers to other endpoints, 'Authorization' : ['Bearer $access_token'], so the token is working alright.
I have made sure that I'm using a header of Content-Type: application/x-www-form-urlencoded when posting to the /WebTicket/oauthtoken endpoint, and that I'm urlencoding the data before posting.
Has anyone else been able to refresh an OAuth token using Lync UCWA 1.0 and a grant_type=password? Any experienced UCWA devs out there recognize what I'm missing in my post to refresh the token?
Thanks in advance.