How is uri from GetCurrentApplicationCallbackUri generated RRS feed

  • Question

  • Does anybody know the particulars on how the URI is generated when calling the API Windows::Security::Authentication::Web::WebAuthenticationBroker::GetCurrentApplicationCallbackUri()?

    I am seeing this value change from time to time, and trying to determine how this string is generated. Is this based on Packaging details, such as Package name, Version, Publisher, etc?  Any insight on how this is generated is appreciated.  I want to try and prevent this from changing and have the same value on all machines and versions for our application.

    • Edited by Will_T1 Thursday, January 23, 2014 7:25 AM
    Friday, January 10, 2014 10:00 PM

All replies

  • The details aren't documented and are subject to change without notice. You cannot safely take a dependency on the value being the same for different instances.


    Saturday, January 11, 2014 2:24 AM
  • Based on the documentation Understanding and debugging the web authentication broker workflow (Windows Store apps using JavaScript and HTML)   http://msdn.microsoft.com/en-us/library/windows/apps/dn448955.aspx

    It states, "The Web authentication broker enables single sign-on (SSO) by allowing persisted cookies in a special purpose SSO app container. To use this container, your app can call the overload of the AuthenticateAsync method that does not take a callback URI. The starting redirect URL must be in the form of "ms-app://<SID>" where <SID> matches the SID of the calling package. You can then register the SID for each of your apps with the authentication service as a valid redirect URL (also referred to as a "redirection endpoint")."

    In the example it talks about at registration time of my app in the Dev Center a unique SID is assigned to my application, which I can then use to register with the authentication service.  If this unique SID is assigned with registration of the app, then shouldn't this value remain the same as I submit new versions of my app to the store? I am wanting to figure out how I can get my local development environment to use that same SID as I am seeing this SID change in our local development environments.  In order to register my SID with the authentication service I need my SID to remain the same for my app, and shouldn't this be the case based on how SSO works, or am I interpreting something incorrectly here from the documentation?

    Wednesday, January 15, 2014 5:25 PM
  • It's not clear to me what you are doing. If you are associating your app with the store and using that URL then it should be consistent.


    Thursday, January 16, 2014 11:17 PM
  • We are using the WebAuthenticationBroker control to authenticate a user in SSO mode.  In order to obtain the postback data from WebAuthenciationBroker control we have to use the application callback URI which is ms-app://{SID}.  My understanding is this {SID} is assigned to you when you submit your application to the dev center.  So if I install the app from the store then the {SID} assigned to my application should be returned when I call GetCurrentApplicationCallbackUri, correct?

    The issue is within my local development environment.  When I install my local dev build for testing purposes the {SID} id being returned to me by calling GetCurrentApplicationCallbackUri is different then the {SID} assigned to me within dev center.  The local dev build {SID} seems to change from time to time on my system, so I want to be able to get my local dev build to use the exact same {SID} assigned to me in the app store.  If I don't get my local dev build to use the same {SID} then we run a huge risk of things possibly not working when we submit our application to the windows store, since my local dev environment and the builds our QA would test before we submit our application to the dev center has a different {SID} so I want local builds and to have the exact same {SID} that has been assigned to me in dev center.  How can this be accomplished?

    I have to be able to test builds we submit to the dev center work correctly with the assigned {SID} within dev center before, but our local builds we are testing to submit to dev center have a different {SID} then what is assigned to us.

    • Edited by Will_T1 Wednesday, January 22, 2014 11:18 PM
    Friday, January 17, 2014 6:59 PM
  • Anyone have any ideas or suggestions?
    Thursday, January 23, 2014 4:58 AM
  • You need to register bot SIDs with your Identity Provider (local SID as well as the one you got from Windows Dev Centre).Then call WAB without passing any return URI parameter. WAB will automatically use your local SID as return URI when launched in SSO (without return URI parameter).

    Your app shouldn't be receiving Local SID "every time you run it". If it does then it would be difficult to keep registering these SIDs with IdP every time but here is a tip if you can't get around with ever-changing SID.

    TIP 1: When  you run an app and stop debugging it, just stop it from Visual Studio. Do not close the app itself. The run VS again and in most probability you should get same SID as previous time. Try not to run GetCurrentApplicationCallbackUri on every launch of app.

    TIP 2: If above tip doesn't work, then follow this sequence. Use GetCurrentApplicationCallbackUri to display the SID on app UI on application start. Register this SID with IdP. Start WAB on user input (like buttin click). I know its painful.


    • Edited by RahulGangwar Friday, August 1, 2014 2:57 PM added a point detail
    • Proposed as answer by RahulGangwar Friday, August 1, 2014 2:58 PM
    Friday, August 1, 2014 2:55 PM