<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Chris's Lync Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/poptart/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/poptart/feed.xml</link>
    <description>Covering Lync/Skype with an emphasis on development</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:47:10 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Collecting Skype For Business Client Logs</title>
      <link>https://docs.microsoft.com/archive/blogs/poptart/collecting-sfb-client-logs</link>
      <pubDate>Fri, 08 Jun 2018 16:10:21 GMT</pubDate>
      <dc:creator><![CDATA[Chris Tart]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/poptart/?p=85</guid>
      <description><![CDATA[While troubleshooting issues involving the Skype for Business client, it may be required to collect...]]></description>
      <content:encoded><![CDATA[While troubleshooting issues involving the Skype for Business client, it may be required to collect logs for support to review. Here I will outline the steps for collecting these logs, so that the best possible data is available.

First we want to ensure logging is enabled. Note that some organizations control this by policy, so the option may not be changeable.
<ol>
 	<li>Within the Skype for Business client, open your options by clicking the gear icon (<img width="34" height="19" class="alignnone size-full wp-image-125" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/06/OptionsGear.jpg" />) in the upper right corner.</li>
 	<li>This should open the Skype for Business - Options window, on the General section.</li>
 	<li>Locate the drop down for "Logging in Skype for Business"
<a href="https://msdnshared.blob.core.windows.net/media/2018/06/LoggingFull.jpg"><img width="506" height="24" class="alignnone size-full wp-image-135" alt="" src="https://msdnshared.blob.core.windows.net/media/2018/06/LoggingFull.jpg" /></a></li>
 	<li>Ensure the "Full" option is selected in the drop down.</li>
</ol>
Next we want to maximize the logging verbosity.  This should only need to be done once on the machine where the logs are being collected from.
<ol>
 	<li>Download <a href="https://msdnshared.blob.core.windows.net/media/2018/06/LyncTracing.zip">LyncTracing.zip</a> and extract it.</li>
 	<li>Run MaxLyncTracing.reg</li>
 	<li>Restart the Skype for Business client to allow these keys to take effect.</li>
</ol>
Next we want to locate our Tracing folder. Skype for Business writes tracing data to a specific location that will depend on the version of the client you are running:
<ul>
 	<li>For Lync 2013/SfB 2015 the Tracing folder is located at:
<ul>
 	<li>%localappdata%/Microsoft/Office/15.0/Lync/Tracing</li>
</ul>
</li>
 	<li>For SfB 2016 the Tracing folder is located at:
<ul>
 	<li>%localappdata%/Microsoft/Office/16.0/Lync/Tracing</li>
</ul>
</li>
</ul>
Finally we will attempt to reproduce the behavior and collect the logs:
<ul>
 	<li>If the issue is easily reproducible then follow these steps:
<ol>
 	<li>Exit the Skype for Business client.</li>
 	<li>Navigate to the Tracing folder outlined above.</li>
 	<li>Delete the contents of the folder.
<ul>
 	<li>Some items may not be able to be deleted if other applications such as Outlook are running.  These can be safely skipped.</li>
</ul>
</li>
 	<li>Launch the Skype for Business client and reproduce your issue.</li>
 	<li>Once completed, exit the Skype for Business client.</li>
 	<li>ZIP the entire <span>Tracing folder.</span></li>
</ol>
</li>
</ul>
<ul>
 	<li>If the issue is intermittent or unpredictable, then follow these steps:
<ol>
 	<li>Continue to use your client until the issue occurs.</li>
 	<li>If possible, exit the client as soon as possible after the issue reproduces.</li>
 	<li>ZIP the entire <span>Tracing folder.</span></li>
</ol>
</li>
</ul>
<ul>
 	<li>Once you have the ZIP file containing your Tracing folder, provide it to the support individual you are working with.</li>
</ul>
Depending on the nature of the issue being looked at, the following may also be helpful:
<ul>
 	<li>A description with the timeframe and steps taken to get the issue.</li>
 	<li>Screenshots of the behavior.</li>
 	<li>If requested, supplemental logs from another source, such as a network trace or Fiddler trace.</li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>AV failures in UCMA on an IPv6 only server</title>
      <link>https://docs.microsoft.com/archive/blogs/poptart/av-failures-in-ucma-on-an-ipv6-only-server</link>
      <pubDate>Wed, 15 Jul 2015 08:38:00 GMT</pubDate>
      <dc:creator><![CDATA[Chris Tart]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/poptart/2015/07/15/av-failures-in-ucma-on-an-ipv6-only-server/</guid>
      <description><![CDATA[I recently handled a case where the customer was reporting consistent AudioVideoCall failures when...]]></description>
      <content:encoded><![CDATA[I recently handled a case where the customer was reporting consistent AudioVideoCall failures when running on a server that was configured for IPv6 only.  If it was configured for IPv4 or dual stack, then it would work fine.

When the issue was hit an exception would be thrown similar to this:

TL_VERBOSE(TF_COMPONENT) [2]1604.01D4::07/10/2015-19:43:29.000.00010996 (Collaboration,MediaAsyncResultT&lt;Ex&gt;.Complete:asyncresult.cs(625))(00000000022B3598)&lt;GenerateOfferWorkitemAsyncResult_22B3598&gt; Owner: &lt;MediaSessionAgent_19142F1&gt; Completing operation: Microsoft.Rtc.Collaboration.AudioVideo.MediaSessionAgent+GenerateOfferWorkitemAsyncResult, Exception: OfferAnswerException [Exception: Microsoft.Rtc.Collaboration.OfferAnswerException
&gt; FailureReason: ServerInternalError
&gt; DiagnosticsInformation: Microsoft.Rtc.Signaling.DiagnosticsInformation
&gt; SignalingHeaders: System.Collections.ObjectModel.ReadOnlyCollection`1[Microsoft.Rtc.Signaling.SignalingHeader]
&gt; DetectionStackTrace:    at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)
at System.Environment.get_StackTrace()
at Microsoft.Rtc.Signaling.RealTimeException..ctor(String message, Exception innerException)
at Microsoft.Rtc.Collaboration.OfferAnswerException..ctor(OfferAnswerFailureReason reason, String message, Exception innerException, IEnumerable`1 signalingHeaders, DiagnosticsInformation diagnosticsInformation)
at Microsoft.Rtc.Collaboration.AudioVideo.MediaSessionAgent.CreateOfferAnswerException(OfferAnswerFailureReason type, Exception e, UInt32 errorCode, RtpEndpoint endpointForDiagBlob)
at Microsoft.Rtc.Collaboration.AudioVideo.MediaSessionAgent.ProcessGenerateOfferWorkitem(GenerateOfferWorkitemAsyncResult workitem)
&gt; Message: An internal media error occurred
&gt; Source: Microsoft.Rtc.Collaboration
&gt; HResult: -2146233088
Inner Exception: Microsoft.Rtc.Internal.Media.EndpointException
&gt; InnerHresult: -1073463292
&gt; Message: Cannot get the transport parameter.
&gt; TargetSite: Void EngineGetTransportParameter(CTransportHandle, UInt32, Void*)
&gt; StackTrace:    at Microsoft.Rtc.Internal.Media.RtpEndpoint.EngineGetTransportParameter(CTransportHandle TransportHandle, UInt32 ulParamName, Void* pParamValue)
at Microsoft.Rtc.Internal.Media.RtpEndpoint.StartListenForConnectivityChecks()
at Microsoft.Rtc.Collaboration.AudioVideo.MediaSessionAgent.StartListenForConnectivityChecksForNewMedia(IList`1 newMediaList)
at Microsoft.Rtc.Collaboration.AudioVideo.MediaSessionAgent.ProcessGenerateOfferWorkitem(GenerateOfferWorkitemAsyncResult workitem)
&gt; Source: Microsoft.Rtc.Internal.Media
&gt; HResult: -2146233088

It seems that in order for UCMA to properly configure the media stack it needs to know exactly what the IP configuration is on the server.

For automatically provisioned applications this is done simply in the topology builder:

<a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/89/19/poolIpv6.png"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/89/19/poolIpv6.png" border="0" /></a>

However for manually provisioned applications it was not immediately obvious how this could be achieved. Attempting to set the platformSettings.OutboundConnectionConfiguration.DefaultAddressFamilyHint did not seem to help.

It turns out that proper way to configure this is to explicitly set the primary listening address as follows (or specifying a specific IP address if preferred):

<span style="font-family: courier new,courier">platformSettings.ListeningIPAddress = IPAddress.IPv6Any;</span>

The defaults within UCMA seem to always end up as DualStack.  By explicitly setting this listening address, we force it to recognize that we are IPv6 only.]]></content:encoded>
    </item>
    <item>
      <title>UCWA sign-in fails while seeing HTTP OPTIONS request</title>
      <link>https://docs.microsoft.com/archive/blogs/poptart/ucwa-sign-in-fails-while-seeing-http-options-request</link>
      <pubDate>Mon, 09 Feb 2015 13:41:00 GMT</pubDate>
      <dc:creator><![CDATA[Chris Tart]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/poptart/2015/02/09/ucwa-sign-in-fails-while-seeing-http-options-request/</guid>
      <description><![CDATA[This is a common issue that I see that is impacted by the Lync deployment itself.&nbsp;You have...]]></description>
      <content:encoded><![CDATA[<p>This is a common issue that I see that is impacted by the Lync deployment itself.&nbsp;You have deployed the UCWA sample, and are trying to sign in, but it always fails. If you check the HTTP traces you can see the following logged towards the end:</p>
<p><span style="font-family:courier new,courier">OPTIONS https://director.nny.local/WebTicket/oauthtoken HTTP/1.1</span><br /><span style="font-family:courier new,courier">Accept: */*</span><br /><span style="font-family:courier new,courier">Origin: https://webdir.nnylync.info</span><br /><span style="font-family:courier new,courier">Access-Control-Request-Method: POST</span><br /><span style="font-family:courier new,courier">Access-Control-Request-Headers: content-type, accept, x-ms-origin</span></p>
<p><span style="font-family:courier new,courier">HTTP/1.1 400 Bad Request</span><br /><span style="font-family:courier new,courier">X-Ms-diagnostics: 28020;source=&quot;Director.NNY.local&quot;;reason=&quot;No valid security token.&quot;</span><br /><span style="font-family:courier new,courier">X-MS-Server-Fqdn: Director.NNY.local<br /><br /></span></p>
<p>Well this is odd, an OPTIONS request?&nbsp; Understanding what is going wrong here requires a little understanding of the&nbsp;same-origin security policy enforced by&nbsp;most modern browsers.&nbsp; As a protection mechanism, browsers will not allow a website loaded from one domain name to make XMLHttpRequest requests to a different domain.&nbsp;&nbsp; This creates a little conundrum for our UCWA API, since one of the goals is to allow people to embed Lync features into their own&nbsp;web applications.</p>
<p>To securely work around this, UCWA leverages an iframe which loads a page from the UCWA API, and then it uses the HTML 5 postMessage function to have it send HTTP requests to that iframe.&nbsp; You can get more details here: <a href="https://ucwa.lync.com/documentation/GettingStarted-CrossDomain">https://ucwa.lync.com/documentation/GettingStarted-CrossDomain</a></p>
<p>There are other methods for managing cross-origin requests, and this explains how we end up with our OPTIONS request.&nbsp; A mechanism called Cross-Origin Resource Sharing (CORS)&nbsp;can be used by browsers to authorize the cross-origin request.&nbsp; You can get details about CORS here: <a href="https://www.w3.org/TR/access-control/">https://www.w3.org/TR/access-control/</a></p>
<p>If a browsers sees that a cross-origin request is about to occur, it will first perform a preflight request to see if the resource is aware of CORS.&nbsp; That&nbsp;preflight request takes the form of the&nbsp;OPTIONS request that we see.&nbsp; Unfortunately UCWA does not support/implement CORS, so this request fails and the startup process terminates.</p>
<p>Since UCWA should be using the iframe, however, why would the browser think a cross-origin request is occurring?&nbsp; Looking one step back in our trace will give us an answer.</p>
<p>During the UCWA startup process, we reach the point where we make our request to the autodiscover service, and we get our first 401:<span style="font-family:courier new,courier"><span><br /></span></span></p>
<p><span style="font-family:courier new,courier"><span lang="EN">GET&nbsp;https://<span style="background-color:#ffff99">webdir.nnylync.info</span>/Autodiscover/AutodiscoverService.svc/root/oauth/user?originalDomain=nnylync.info</span><span><span lang="EN"> HTTP/1.1</span></span></span></p>
<p><span style="font-family:courier new,courier">HTTP/1.1 401 Unauthorized<br />WWW-Authenticate: Bearer trusted_issuers=&quot;&quot;, client_id=&quot;00000004-0000-0ff1-ce00-000000000000&quot;<br />WWW-Authenticate: MsRtcOAuth href=&quot;https://<span style="background-color:#ffff99">director.nny.local</span>/WebTicket/oauthtoken&quot;,grant_type=&quot;urn:microsoft.rtc:windows,urn:microsoft.rtc:passive,urn:microsoft.rtc:anonmeeting,password&quot;<br /><br /></span></p>
<p>Note that our request here is going to webdir.nnylync.info, however the MsRtcOAuth href in the response&nbsp;is directing us to director.nny.local. For context, webdir.nnylync.info is the external web services FQDN for my director pool, and director.nny.local is the internal web services FQDN for my director pool.</p>
<p>Now this begins to make some sense.&nbsp; We have an iframe for webdir.nnylync.info, but&nbsp;our next&nbsp;request would be&nbsp;trying to go to director.nny.local which would&nbsp;be cross-domain.</p>
<p>So the real question; why is the MsRtcOAuth href directing us to director.nny.local?</p>
<p>The answer is that it is based on which IIS website we hit on the front end.&nbsp; Lync has two websites, Lync Server External Web Site, and Lync Server Internal Web Site. The internal website operates on 443.&nbsp; The external website operates on 4443.&nbsp; Additionally in the Lync topology you define an internal and external web services FQDN for each pool.</p>
<p>It is expected that requests coming in from the public internet will be going through a reverse proxy which will apply a port translation rule going from 443 to 4443.&nbsp; Therefore all requests from the public internet should land on the external website, and requests on the internal network can land on the internal website.&nbsp;</p>
<p>UCWA understands whether it is running on the internal or external side, and this will change which FQDN&#039;s get returned in responses.&nbsp; Since the MsRtcOAuth href contains the <em>internal</em> web services FQDN, that means our request must be landing on the <em>internal website</em>.</p>
<p>In this case, the fact that we hit the internal website while having used the external web services FQDN is the problem.&nbsp; UCWA is designed to channel all traffic&nbsp;through the external web services FQDN.&nbsp; This is done for use cases where a device (like a mobile app) could transition from the internal and external networks throughout the day.&nbsp; In order to keep a consistent connection point for the application, UCWA requires all traffic, both internal and external, to go through the external web site.&nbsp;</p>
<p><strong>That means that the external web service FQDN resolved by an internal user should still point to the public IP/outside interface IP of the reverse proxy.&nbsp; It should NOT be going directly to the front end server/director IP.</strong></p>
<p>This image,&nbsp;coming from TechNet documentation, shows this scenario well.</p>
<p><a href="https://i-technet.sec.s-msft.com/dynimg/IC626916.jpg"><img alt=" " src="https://i-technet.sec.s-msft.com/dynimg/IC626916.jpg" border="0" /></a></p>
<p></p>
<p>You can see these articles for more details regarding this:</p>
<p><a href="https://ucwa.lync.com/documentation/ITAdmin-Architecture">https://ucwa.lync.com/documentation/ITAdmin-Architecture</a></p>
<p><a href="https://technet.microsoft.com/en-us/library/hh690030.aspx">https://technet.microsoft.com/en-us/library/hh690030.aspx</a></p>
<p></p>
<p>Also, for a small test environment that does not have external access configured, you can work around this problem by simply making the external web services FQDN match the internal web services FQDN&nbsp;in the Lync topology.&nbsp; Then, regardless of the situation, all connections should land on the Lync internal web site, and since the two web services FQDN&#039;s match, there is no cross-domain issue.&nbsp; This should only be done for test environments, since making this change would cause breaking issues in a production environment where external services are expected to work on the public internet.</p>]]></content:encoded>
    </item>
    <item>
      <title>Failed logins with UCWA sample</title>
      <link>https://docs.microsoft.com/archive/blogs/poptart/failed-logins-with-ucwa-sample</link>
      <pubDate>Fri, 30 Jan 2015 12:13:00 GMT</pubDate>
      <dc:creator><![CDATA[Chris Tart]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/poptart/2015/01/30/failed-logins-with-ucwa-sample/</guid>
      <description><![CDATA[This is a pretty common issue that comes up.&nbsp; One downloads the UCWA sample and sets it...]]></description>
      <content:encoded><![CDATA[<p>This is a pretty common issue that comes up.&nbsp; One downloads the UCWA sample and sets it up.&nbsp; However when they go to sign in, they fail each time with an error &quot;Login failed.&quot;</p>
<p>If you check the HTTP response you&#039;ll see:</p>
<p><span style="font-family:courier new,courier">HTTP/1.1 400 Bad Request</span><br /><span style="font-family:courier new,courier">Content-Length: 25</span><br /><span style="font-family:courier new,courier">Content-Type: application/json</span><br /><span style="font-family:courier new,courier">X-Ms-diagnostics: 28020;source=&quot;Director.NNY.local&quot;;reason=&quot;No valid security token.&quot;</span></p>
<p><span style="font-family:courier new,courier">{&quot;error&quot;:&quot;invalid_grant&quot;}</span></p>
<p>At its core, invalid_grant simply means you were unable to be authorized.&nbsp; Possibly bad credentials, or some other reason.&nbsp; (See <a href="https://ucwa.lync.com/documentation/GettingStarted-Authentication">https://ucwa.lync.com/documentation/GettingStarted-Authentication)</a></p>
<p>However in this case people will swear they are putting in the correct information.</p>
<p>The reason for this failure&nbsp;is actually pretty simple, but due to the design of the sample it is not always the first thought that comes to mind.&nbsp; The sample only includes a field for your Sign-in address and password, but no username.&nbsp; It makes an assumption that the users SIP sign-in address will be the same as their UPN.&nbsp; If this is not valid for the environment the sample is running in, then there is effectively no way to sign into the sample without making some changes.</p>
<p>The simplest solution is to just add a 3rd text box to allow a username to be entered separately from the sign-in address:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/89/19/UCWA%20Sign-in.JPG"><img alt=" " src="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/89/19/UCWA%20Sign-in.JPG" border="0" /></a></p>
<p></p>
<p>Attached are some changed&nbsp;sample files that can be used to achieve this.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/8919/00/00/03/64/44/43/UCWASamples%20Login%20Fix.zip">UCWASamples Login Fix.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>UCWA with directors or multiple pools</title>
      <link>https://docs.microsoft.com/archive/blogs/poptart/ucwa-with-directors-or-multiple-pools</link>
      <pubDate>Wed, 28 Jan 2015 10:30:21 GMT</pubDate>
      <dc:creator><![CDATA[Chris Tart]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.technet.microsoft.com/poptart/2015/01/28/ucwa-with-directors-or-multiple-pools/</guid>
      <description><![CDATA[In developing a UCWA application, you may come across a situation where you end up transitioning...]]></description>
      <content:encoded><![CDATA[<p>In developing a UCWA application, you may come across a situation where you end up transitioning between more than one pool during the start-up process.&nbsp;The documentation on <a href="https://ucwa.lync.com/">https://ucwa.lync.com</a> is light on this area, and the provided UCWA sample does not handle this scenario directly. If you do not properly handle the web ticketing during pool changes, then you will commonly run into an error once you try to access your applications resource.&nbsp;</p>
<p><span style="font-family:courier new,courier">HTTP/1.1 500 Internal Server Error</span><span style="font-family:courier new,courier"><br /></span><span style="font-family:courier new,courier">X-Ms-diagnostics: 28032;source=&quot;Lync-SE.NNY.local&quot;;reason=&quot;The web ticket is invalid.<br /></span></p>
<p>If you follow the steps listed on <a href="https://ucwa.lync.com/documentation/KeyTasks-CreateApplication">https://ucwa.lync.com/documentation/KeyTasks-CreateApplication</a> then the first time the problem will surface will generally be on Step 9.&nbsp; Instead of getting a 201 as expected, you may get the above 500 error instead.&nbsp; The reason this occurs is because you have used a web ticket from one pool when trying to communicate with a different pool.&nbsp; Web tickets are only valid on the pool which issued them.&nbsp;</p>
<p>You&nbsp;may have to change pools&nbsp;because your environment uses directors to service lyncdiscover.domain.com, or you have multiple Lync front end pools and lyncdiscover.domain.com is pointed at Pool A, but your actual user account is homed on Pool B.&nbsp; In either of these cases, your initial connection steps will be completed against the pool servicing lyncdiscover.domain.com up to step 8.&nbsp; At step 8 if your account is hosted on a different pool, then the _links provided will have the external web services FQDN for your home pool, instead of the FQDN you had been connected to up to this point.</p>
<p>This may look something like this:</p>
<p><span style="font-family:courier new,courier">GET <span style="background-color:#ffff00">https://webdir.nnylync.info/Autodiscover/AutodiscoverService.svc/root/oauth/user</span>?originalDomain=nnylync.info HTTP/1.1</span><br /><span style="font-family:courier new,courier">Authorization: Bearer cwt=AAEBHAEFAAAAAAAFFQAAALtGgOI4o_RhEkWWK1MEAACBEDp8srKSInRRsMUh3b7vStaCArAQgyCi3SnwxgLCUr_YoF_XOv0-ZnI-np_NhzH8eCu_yHEXfoYIXmTYAt5_0QgNEDp8srKSInRRsMUh3b7vStY</span></p>
<p><span style="font-family:courier new,courier">HTTP/1.1 200 OK</span><br /><span style="font-family:courier new,courier">Content-Length: 269</span><br /><span style="font-family:courier new,courier">Content-Type: application/json</span></p>
<p><span style="font-family:courier new,courier">{&quot;_links&quot;:{&quot;self&quot;:{&quot;href&quot;:&quot;<span style="background-color:#ffff00">https://lyncweb.nnylync.info/Autodiscover/AutodiscoverService.svc/root/user</span>&quot;},&quot;applications&quot;:{&quot;href&quot;:&quot;https://lyncweb.nnylync.info/ucwa/oauth/v1/applications&quot;},&quot;xframe&quot;:{&quot;href&quot;:&quot;https://lyncweb.nnylync.info/Autodiscover/XFrame/XFrame.html&quot;}}}</span></p>
<p>If you&#039;ll note, the GET was sent to webdir.nnylync.info, while the _links in the response are all to lyncweb.nnylync.info.</p>
<p>If we then blindly proceed with step 9 and send the POST to https://lyncweb.nnylync.info/ucwa/oauth/v1/applications while including the Authorization header, then we will run into the 500 error response, since the web ticket we have is issued for webdir.nnylync.info,&nbsp;and is not valid on lyncweb.nnylync.info.</p>
<p>The best way to deal with this situation will be to detect when the domain for our request changes, and if it does, omit the Authorization header.&nbsp; By omitting the Authorization header the connection to the new pool will throw a 401 allowing you to retrieve a new web ticket from the new pool.&nbsp; Basically you can jump back to step 4, proceed to the point where you have the web ticket at step 6, and then resume your request on step 9 and include the new web ticket in the Authorization header which should now succeed since it is a web ticket from that pool.</p>
<p>Continuing from the previous response it might look like this:</p>
<p><span style="font-family:courier new,courier">POST https://lyncweb.nnylync.info/ucwa/oauth/v1/applications HTTP/1.1</span><br /><span style="font-family:courier new,courier">Accept: application/json</span><br /><span style="font-family:courier new,courier">Content-Type: application/json</span></p>
<p><span style="font-family:courier new,courier">{&quot;userAgent&quot;:&quot;UCWA Samples&quot;,&quot;endpointId&quot;:&quot;380a9e10-c680-488c-8f15-94e7cd87d28f&quot;,&quot;culture&quot;:&quot;en-US&quot;}</span></p>
<p><span style="font-family:courier new,courier">HTTP/1.1 401 Unauthorized</span><br /><span style="font-family:courier new,courier">WWW-Authenticate: Bearer trusted_issuers=&quot;&quot;, client_id=&quot;00000004-0000-0ff1-ce00-000000000000&quot;</span><br /><span style="font-family:courier new,courier">WWW-Authenticate: MsRtcOAuth href=&quot;https://lyncweb.nnylync.info/WebTicket/oauthtoken&quot;,grant_type=&quot;urn:microsoft.rtc:windows,urn:microsoft.rtc:anonmeeting,password&quot;</span></p>
<p></p>
<hr style="width:75%" />
<p><span style="font-family:courier new,courier">POST https://lyncweb.nnylync.info/WebTicket/oauthtoken HTTP/1.1</span><br /><span style="font-family:courier new,courier">Accept: application/json</span><br /><span style="font-family:courier new,courier">Content-Type: application/x-www-form-urlencoded;charset=&#039;utf-8&#039;</span><br /><span style="font-family:courier new,courier">Content-Length: 57</span></p>
<p><span style="font-family:courier new,courier">grant_type=password&amp;username=nny%5Cfry&amp;password=********</span></p>
<p><span style="font-family:courier new,courier">HTTP/1.1 200 OK</span><br /><span style="font-family:courier new,courier">Content-Length: 250</span><br /><span style="font-family:courier new,courier">Content-Type: application/json</span></p>
<p><span style="font-family:courier new,courier">{&quot;access_token&quot;:&quot;cwt=AAEBHAEF...FECMUFwI&quot;,&quot;expires_in&quot;:28132,&quot;ms_rtc_identityscope&quot;:&quot;local&quot;,&quot;token_type&quot;:&quot;Bearer&quot;}</span></p>
<p></p>
<hr style="width:75%" />
<p><span style="font-family:courier new,courier">POST https://lyncweb.nnylync.info/ucwa/oauth/v1/applications HTTP/1.1</span><br /><span style="font-family:courier new,courier">Accept: application/json</span><br /><span style="font-family:courier new,courier">Content-Type: application/json</span><br /><span style="font-family:courier new,courier">Authorization: Bearer cwt=AAEBHAEF...FECMUFwI</span><br /><span style="font-family:courier new,courier">Content-Length: 98</span></p>
<p><span style="font-family:courier new,courier">{&quot;userAgent&quot;:&quot;UCWA Samples&quot;,&quot;endpointId&quot;:&quot;380a9e10-c680-488c-8f15-94e7cd87d28f&quot;,&quot;culture&quot;:&quot;en-US&quot;}</span></p>
<p><span style="font-family:courier new,courier">HTTP/1.1 201 Created</span><span style="font-family:courier new,courier"><br /></span></p>
<p><span style="font-family:courier new,courier"><br /></span>Attached is a version of Authentication.js which has been modified to handle this scenario.&nbsp; It may not be the best solution, but this should demonstrate the process outlined above and allow the sample to work in this kind of topology.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/TNBlogsFS/prod.evol.blogs.technet.com/telligent.evolution.components.attachments/01/8919/00/00/03/64/43/18/Authentication.js">Authentication.js</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>