locked
Wi-Fi hotspot authentication sample ProvisioningAgent generate exception

    Question

  • Hi,

    I am actually facing an issue to manage a WLAN profile thanks to a ProvisioningAgent in Metro application. I have first tried to excecute my WLANProfile through the Wi-Fi hotspot authentiction sample and in a custom app but both are generating an exception without any clue about what's going wrong except a HResult value 0x82170002.

    Here is the code:

    ProvisioningAgent^ provisioningAgent = ref new ProvisioningAgent();
    	
    	task<ProvisionFromXmlDocumentResults^ > provisionTask(provisioningAgent->ProvisionFromXmlDocumentAsync(profile));
    	
    	provisionTask.then([this](task<ProvisionFromXmlDocumentResults^> resultTask)
    	{
           try
            {		
                // Try getting all exceptions from the continuation chain above this point.
                // Get will throw an exception if the task failed with an error.
                auto result = resultTask.get();
    
                if (result->AllElementsProvisioned)
                    // Provisioning is done successfully
                    return 0;
    			return -1;
            }
            catch (Exception^ ex)
            {
    	String^ message = ex->Message;
    	int result = ex->HResult;
    			
                return -1;
    		}
    	});
    <?xml version="1.0" encoding="utf-8"?>
    <CarrierProvisioning xmlns="http://www.microsoft.com/networking/CarrierControl/v1">
    <Global>
    <CarrierId>{11111111-1111-1111-1111-111111111111}</CarrierId>
    <SubscriberId>1234567890</SubscriberId>
    </Global>
    <WLANProfiles>
    <WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1">
    <name>Christophe</name>
    <SSIDConfig> <SSID> <hex>xxx</hex> <name>xxx</name> </SSID>
     </SSIDConfig><connectionType>ESS</connectionType> <connectionMode>manual</connectionMode>
    <ProfileData>
    <MSM> 
    <security> 
    <authEncryption> <authentication>WPA2PSK</authentication> <encryption>AES</encryption>
    
    <useOneX>false</useOneX> </authEncryption><sharedKey> <keyType>passPhrase</keyType> <protected>true</protected>
    <keyMaterial>xxxx</keyMaterial> </sharedKey> </security> </MSM></ProfileData> </WLANProfile></WLANProfiles></CarrierProvisioning>

    Can you help me to understand what is going wrong ?

    Thanks

    Christophe

    Saturday, April 7, 2012 1:43 PM

Answers

  • You’ll need to generate a signing certificate and sign the provisioning file first, using the ProvisioningTestHelper.psd1 tool in the SDK:

    • Launch Powershell elevated.
    • Use the Powershell command “Import-Module” to load the psd1 file.
    • That will add the cmdlets “Install-TestEVCert” (to generate a new signing certificate) and “ConvertTo-SignedXml” (to use the cert for signing an XML file).

    To remove the BOM, you'll need to open the signed file in Notepad and re-save with the encoding set to "ANSI" if you're using the C# or JS versions of the sample.

    Thursday, April 26, 2012 10:24 PM
  • The schema files are documented at http://msdn.microsoft.com/en-us/library/windows/apps/hh868312.aspx, or you can look at the schema file directly at C:\Windows\schemas\Provisioning\ on a Windows 8 install and see the rules it's using to determine valid values per the schema.  A few restrictions can't be expressed in XSD, so they'll show up as failures (on the ProvisionFromXmlDocumentResults.ProvisionResultsXml property, if they're not fatal).

    Thursday, April 26, 2012 10:32 PM
  • Following is a simple html page with script that does the provisining,

    <!doctype html>
    <!-- saved from url=(0014)about:internet -->
    <html>
    <head>
    <script>
    function Log(logstring)
    {
    	var txtResult = document.getElementById("txtResult");
    	txtResult.innerText = logstring;
    }
    
    function LogException(e)
    {
    	Log("Exception: " + decimalToHexString(e.number) + " (" + e.toString() + ")");
    }
    
    function decimalToHexString(number)
    {
        if (number < 0)
        {
            number = 0xFFFFFFFF + number + 1;
        }
        return number.toString(16).toUpperCase();
    }
    
    function mapProvResultToString(provResultCode)
    {        
        var arrResultStrings = [
            "ProvisioningSuccess",
            "ProvisioningErrorGeneralFailure",
            "ProvisioningErrorInvalidSchema",
            "ProvisioningErrorNotSigned",
            "ProvisioningErrorInvalidSignature",
            "ProvisioningCancelled",
            "ProvisioningWiFiDeviceNotPresent",
            "ProvisioningMobileBroadbandDeviceNotPresent",
            "ProvisioningMultipleHardwareNotPresent"
            ];
    
        if (provResultCode < arrResultStrings.length)
        {
            return arrResultStrings[provResultCode];
        }
        else
        {
            return "Unknown";
        }
    }
    
    function testProvision()
    {
        try
        {
            var input = document.getElementById("inputProvXml");
            var result = window.external.msProvisionNetworks(input.value);
            Log(mapProvResultToString(result) + " (" + result + ")");
        }
        catch (e)
        {
            LogException(e);
        }
    }
    
    function download()
    {
    	var provUrl = document.getElementById("txtProvUrl").value;
    	try
    	{
    		Log("Downloading from " + provUrl);
    		var request = new XMLHttpRequest();
    		request.open("GET", provUrl, false);
    		request.send();
    		document.getElementById("inputProvXml").value = request.responseText;
    		Log("Download complete");
    	}
    	catch (e)
    	{
    		LogException(e);
    	}
    }
    </script>
    </head>
    <body>
    URL: <input type=text id="txtProvUrl"><input type=button onclick="download()" value="Download XML">
    <p>
    Provisioning XML:<br>
    <textarea id="inputProvXml" rows="10" cols="80"></textarea>
    <p>
    <input type=button onclick="testProvision()" value="Provision"/>
    <p>
    Result: <pre id="txtResult"/>
    </body>
    </html>

    Wednesday, May 2, 2012 4:31 PM

All replies

  • Hi,

    After looking around i found this:

    ·	Applying Provisioning XML to the PC
    From a Metro style device app for mobile broadband:
    ·	Instantiate a ProvisioningAgent instance (using Windows.Networking.NetworkOperators.ProvisioningAgent.CreateFromNetworkAccountId).
    ·	Call IProvisioningAgent::ProvisionFromXmlAsync, passing in the unsigned provisioning XML document.
    
    The asynchronous operation will complete and the results of the provisioning operation are returned.
    From a Metro style app other than a device app for mobile broadband:
    ·	Generate a signed Account Provisioning XML document.
    ·	Instantiate a ProvisioningAgent instance (using the default constructor).
    ·	Call IProvisioningAgent::ProvisionFromXmlAsync, passing in the signed XML document.
    

    I guess i am in the case "other than a device app for mobile broadband" as i am targetting wifi. Can anyone give me information about "Generate a signed Account Provisioning XML document" ?

    Thanks

    Christophe

    Saturday, April 7, 2012 8:21 PM
  • Hello,

    Would you please provide us more information about this issue, like the driver version. Did you change any codes in this sample code?

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Monday, April 9, 2012 9:26 AM
  • Hi Jesse,

    I am using a Atheros AR9002WB-1NG Wireless Network Adapter on a Acer iconia tab w500.

    On this sample i have only replaced the DataProvisioning content with the one given in the first post. I have tried to write my own sample to troubleshoot but i got the same error.

    I suspect something wrong on the xml content as it as changed between metro style and wlanapi desktop style application.

    I got able to initiate wifi connection with desktop application and i am still on this issue.

    Thank you for your help.

    Christophe

    Monday, April 9, 2012 5:18 PM

  • Any help or guidance to get a ProvisionningAgent working ?
    Wednesday, April 11, 2012 7:46 PM
  • Hi Christophe - if you'll send me a sample application and explain how to set all of this up for testing, I can try it on my local Acer W500 to figure out what's wrong.  My email is MSMALL at Microsoft.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator

    Friday, April 13, 2012 1:23 PM
    Moderator
  • Hello Matt,

    I think you can try to execute the "Wi-Fi hotspot authentiction sample". I have tried it too using my Access Point informations.

    If you are able to connect to it please let me know the procedure you followed and how the Profile file looks like.

    Thanks

    Christophe

    Wednesday, April 18, 2012 2:03 PM
  • I'm facing a similar issue. Our wifi also use WPA2PSK. But I have no idea how to add the security key. I can't even find the schema for this profisioning XML file for wifi hotspot. BTW what does the <useOneX> mean?

    Thursday, April 19, 2012 11:43 PM
  • I ran the WiFi hotspot sample with the following xml

    <?xml version="1.0" encoding="utf-8"?>
    <CarrierProvisioning xmlns="http://www.microsoft.com/networking/CarrierControl/v1">
      <Global>
        <!-- Adjust the Carrier ID to fit your own ID. Refer to the MSDN documentation about Carrier ID's. -->
        <CarrierId>{11111111-1111-1111-1111-111111111111}</CarrierId>
        <!-- Adjust the Susbscriber ID. Refer to the MSDN documentation about Subscriber ID's. -->
        <SubscriberId>1234567890</SubscriberId>
      </Global>
      <WLANProfiles>
        <WLANProfile xmlns="http://www.microsoft.com/networking/CarrierControl/WLAN/v1">
          <!-- Adjust the profile name to have a human readable network name. By default this equals the SSID. -->
          <name>Our Wi-Fi</name>
          <SSIDConfig>
            <SSID>
              <!-- Adjust the SSID name to fit the SSID of the hotspot. -->
              <name>MIC</name>
            </SSID>
          </SSIDConfig>
          <MSM>
            <security>
              <authEncryption>
                <authentication>WPA2</authentication>
                <encryption>PSK</encryption>
                <networkKey>password</networkKey>
                <useOneX>false</useOneX>
              </authEncryption>
              <HotspotProfile xmlns="http://www.microsoft.com/networking/WLAN/HotspotProfile/v1">
                <ExtAuth>
                  <!-- Adjust the extension ID to match the package family name of the application running the background task handler. -->
                  <ExtensionId>HotspotAuthenticationSampleCS_8wekyb3d8bbwe</ExtensionId>
                </ExtAuth>
              </HotspotProfile>
            </security>
          </MSM>
        </WLANProfile>
      </WLANProfiles>
    </CarrierProvisioning>

    And got the exception "System.Runtime.InteropServices.COMException" when executing the line,

    ProvisionFromXmlDocumentResults result = await provisioningAgent.ProvisionFromXmlDocumentAsync(provisioningXml);

    Friday, April 20, 2012 12:23 AM
  • Hello,

    I faced with a similar problem wile providing mobilebroadband provisioning data. 

    I read some documents and as stated in "Providing Mobile Broadband Metadata"  document,

    If the provisioning xml is malformed or invalid according to the provisioning schema, an event will be logged. The payload of the event will indicate why the parse/schema validation operation failed. This event is logged under the following channel and is viewable using the Event Viewer:

    Applications and Services Logs\Microsoft\Windows\NetworkProvisioning\Operational


    When i looked at event viewer i realized that my provisioning data fails xml schema validation. And all the information like which field is not valid and why was there.

    Hope this helps

    Mehmet

    Saturday, April 21, 2012 6:45 AM
  • Hi Mehmet,

    Thank you. It seems my case is a bit different. The event I got didn't give me much info than the following,

    Provisioning results for caller application (AppId HotspotAuthenticationSampleCS_8wekyb3d8bbwe!HotspotAuthenticationSampleApp.App): [Unknown HResult Error code: 0x8217000e]

    Looks like the xml file was OK. However, the call to the underlying layer got some error back, which I had no clue what it meant.

    Daniel

    Monday, April 23, 2012 5:09 PM
  • I did the following experiments. If the xml file doesn't follow the schema, I got two events and the error was,

    "Unknown HResult Error code: 0x82170002"

    When the xml file was correct, I got one event and the error was,

    Unknown HResult Error code: 0x8217000e

    Anybody know what it meant?

    Thanks a lot.

    Daniel

    Monday, April 23, 2012 5:27 PM
  • have you emailed the problem to windowswireless at microsoft.com ? 

    They really care questions coming from different people. 


    Monday, April 23, 2012 6:23 PM
  • No, I haven't. How can I do it? Use the Feedback tool?
    Monday, April 23, 2012 7:58 PM
  • No tool required just send an email, describing your problem and including related info, to windowswireless@microsoft.com, AFAIK they created this mail group to get questions from us and respond as much as possible.
    Monday, April 23, 2012 8:02 PM
  • Thank you so much, Mehmet. Will do it right away.
    Monday, April 23, 2012 8:17 PM
  • Christophe - I'm working on this today.  Sorry for the delay.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator

    Tuesday, April 24, 2012 3:08 PM
    Moderator
  • As Mehmet suggested, I contacted windowswireless team and followed their instructions and generated the signed xml profile, and I only changed two fields (in bold below) in the sample xml profile as following,

    <?xml version="1.0" encoding="utf-8"?>
    <CarrierProvisioning xmlns="http://www.microsoft.com/networking/CarrierControl/v1">
      <Global>
        <!-- Adjust the Carrier ID to fit your own ID. Refer to the MSDN documentation about Carrier ID's. -->
        <CarrierId>{11111111-1111-1111-1111-111111111111}</CarrierId>
        <!-- Adjust the Susbscriber ID. Refer to the MSDN documentation about Subscriber ID's. -->
        <SubscriberId>1234567890</SubscriberId>
      </Global>
      <WLANProfiles>
        <WLANProfile xmlns="http://www.microsoft.com/networking/CarrierControl/WLAN/v1">
          <!-- Adjust the profile name to have a human readable network name. By default this equals the SSID. -->
          <name>Our Wi-Fi</name>
          <SSIDConfig>
            <SSID>
              <!-- Adjust the SSID name to fit the SSID of the hotspot. -->
              <name>BentallkKennedy-guest</name>
            </SSID>
          </SSIDConfig>
          <MSM>
            <security>
              <authEncryption>
                <authentication>open</authentication>
                <encryption>none</encryption>
                <useOneX>false</useOneX>
              </authEncryption>
              <HotspotProfile xmlns="http://www.microsoft.com/networking/WLAN/HotspotProfile/v1">
                <ExtAuth>
                  <!-- Adjust the extension ID to match the package family name of the application running the background task handler. -->
                  <ExtensionId>HotspotAuthenticationSampleCS_8wekyb3d8bbwe</ExtensionId>
                </ExtAuth>
              </HotspotProfile>
            </security>
          </MSM>
        </WLANProfile>
      </WLANProfiles>
    <Signature xmlns="http://www.w3.org/2000/09/xmldsig#"><SignedInfo><CanonicalizationMethod Algorithm="http://www.w3.org/TR/2001/REC-xml-c14n-20010315" /><SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" /><Reference URI=""><Transforms><Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" /></Transforms><DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" /><DigestValue>jLvJJAXe9AlZSf4V63lnDJ2pj5c=</DigestValue></Reference></SignedInfo><SignatureValue>FkXU6HfZWzI0RHsC/fWONr9OB2tcwNMj2lh4cX+QSCYgCRESd9TnUe+U0ykwRpJNZKN91Ayaqg9ttKynD0+V36Rm+e/ofzQ176TsmeaW0xHRLuCbQPaU1tm4+U7JuVHyYd4z1kPGKLaZEqoUV+M8uOJ7Ntn97lHXe2RpZbJco8w5hQDQ2hqza4ffhboH4xGGGTVHbYJ/CegPQtkrmDne3XBZq9TR8rprs/knSWTc+x8dD7mz0+9f3yEkrsI58AfxZ1Gus1rWMOvUGwe/fP24bvh9DvlU+zmltBYXMZI4AXMdPU7gNz2uuDssi6ssIiXZUWTVvpEAYBykmz/1kAmWDA==</SignatureValue><KeyInfo><X509Data><X509Certificate>MIIDtjCCAp6gAwIBAgIQGC0TfZmFQ6JBBQz4g9Y8YjANBgkqhkiG9w0BAQUFADBjMWEwFwYDVQQLHhAAVwBpAG4AZABvAHcAcwAAMBsGA1UECh4UAE0AaQBjAHIAbwBzAG8AZgB0AAAwKQYDVQQDHiIATQBCAEEAUABUAGUAcwB0AFIAbwBvAHQAQwBlAHIAdAAAMB4XDTExMDQyMzIzNDM0OVoXDTEzMDQyMzIzNDM0OVowWzFZMBcGA1UECx4QAFcAaQBuAGQAbwB3AHMAADAbBgNVBAoeFABNAGkAYwByAG8AcwBvAGYAdAAAMCEGA1UEAx4aAE0AQgBBAFAAVABlAHMAdABDAGUAcgB0AAAwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDSX01XL8h7qvnyeoWQfc54WsD6V/VvYDdKs8LJsb/YcNvZFwJc2NBLMVJrTo8WqOHnKLJ9zhnfe5mGFrbaVYGx2BcymEhMjtKYZbqVO9hiiHFFnNOQr0J9gcFEJ4QUEqqnkhWJnQAQZlTY40p+ANRx6aVhSgFTsqY+YqqbCA6EcH69PM7gyS43Bu0CXybNEjg4w/lE8YVm3Op2k5kmep3fZdME/72nhZ3e4K1S/E1gxQ//fNAEL2IwqD+o0z3Wm8UcX3d7AX0x6Cuwa5/zsb37KNb0UK9iiTHz/o0XF3WA5dSfOg976RzR4zerr+4u8vWs94uA64RIqDY1vhM2okprAgMBAAGjbjBsMAwGA1UdEwEB/wQCMAAwDgYDVR0PAQH/BAQDAgXgMEwGA1UdIAEB/wRCMEAwPgYIKgMEBQYHCAkwMjAwBggrBgEFBQcCAR4kAGgAdAB0AHAAOgAvAC8AZgBvAG8ALgBjAG8AbQAvAGMAcABzMA0GCSqGSIb3DQEBBQUAA4IBAQB5Jv55PjXId2q6JLTWCwF1UJteu3xQ5awI51Lw76DDIIG1fdtDGAwIYXpT5ZDK1A34W8wd3Xz6GDwcP+JBV/rTSV+lPLah93OxTkLgnp/8yXfJ3MGLEy5tTWNyF6bx3DhY+Z3PWkoR0OVmuVuGvvdixj824VXNbcw3zA1UT1GeFMBby4YqMB6KZ8fkiAqTEAmmjIAM5bkIoGzMI67phvf/oAmpSFN/2kZGyviw1J5OMNP9tuj5DqoR+6Z6TwJoy0dTVgKfmgPJWoOjiKoq+TKq5jZDAW5lyu1F5ZImRNS+J38I8BcFg4se5yTSQkwA0ZLYWetYyc2k97iFJsMHgCIN</X509Certificate></X509Data></KeyInfo></Signature>
    </CarrierProvisioning>
    

    This time I got a different error,

    XML stream rejected because of a parse error

    [Details]

    Error code: 0x800705B9

    Error Message: Windows was unable to parse the requested XML data.

    Description: NULL

    At this point, I'm not sure what the above Error Message mean. Whether it doesn't like the xml file content, or some other problem of the xml parser? But it seem to me the xml file passed the schema check. (If I changed the <encryption> item to some invalid value, the error would tell me the valid values devinded in the schema. Being lack of document, this is a way to find out what you can put in some of the fields in the xml file ;-)

    Being from the Linux world, I was so used to the open source, with which I could navigate into the source code and find out what the problem is. With windows, I'm totally blind. :-(

    Daniel

    Tuesday, April 24, 2012 6:21 PM
  • This is a summary of what I found out in the past few days,

    Unknown HResult Error code: 0x8217000e --- This means the xml profile was not signed

    Unknown HResult Error code: 0x82170002 --- This means your xml profile has some invalid value and failed the schema check

    Unknown HResult Error code: 0x82170001 --- "Windows was unable to parse the requested XML data." This is where I'm stuck.

    Tuesday, April 24, 2012 6:45 PM
  • Got it!

    With the help of the wireless team, that was caused by a "known bug" in the CP xml parser. Get rid of the BOM character in the signed xml file and it went thru.

    Many thanks to the windowswireless team, and to Mehmet for providing me their contact info! Really appreciated.

    Wednesday, April 25, 2012 12:23 AM
  • Does this resolve Christophe's issue?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator

    Wednesday, April 25, 2012 2:01 PM
    Moderator
  • It should. He was at,

    Unknown HResult Error code: 0x82170002 --- This means your xml profile has some invalid value and failed the schema check

    which he only needs to fix his xml profile.

    Wednesday, April 25, 2012 4:32 PM
  • OK - I'll wait on his response before doing anything else. Thanks for your work!

    Matt Small - Microsoft Escalation Engineer - Forum Moderator


    Wednesday, April 25, 2012 6:12 PM
    Moderator
  • Now i have the 0x8217000e error. Which make sense i have not signed my xml document.

    I am actually reading information through the web but i don't see anything obvious regarding how to manage xml signature like Dan did.

    How did we manage to get those digest and certificate ?

    Thanks

    Christophe



    Thursday, April 26, 2012 4:32 PM
  • You’ll need to generate a signing certificate and sign the provisioning file first, using the ProvisioningTestHelper.psd1 tool in the SDK:

    • Launch Powershell elevated.
    • Use the Powershell command “Import-Module” to load the psd1 file.
    • That will add the cmdlets “Install-TestEVCert” (to generate a new signing certificate) and “ConvertTo-SignedXml” (to use the cert for signing an XML file).

    To remove the BOM, you'll need to open the signed file in Notepad and re-save with the encoding set to "ANSI" if you're using the C# or JS versions of the sample.

    Thursday, April 26, 2012 10:24 PM
  • The schema files are documented at http://msdn.microsoft.com/en-us/library/windows/apps/hh868312.aspx, or you can look at the schema file directly at C:\Windows\schemas\Provisioning\ on a Windows 8 install and see the rules it's using to determine valid values per the schema.  A few restrictions can't be expressed in XSD, so they'll show up as failures (on the ProvisionFromXmlDocumentResults.ProvisionResultsXml property, if they're not fatal).

    Thursday, April 26, 2012 10:32 PM
  • Thank you Mike.

    I think i will help for my testings but from my understanding it looks like i need to sign my xml file by hands through powershell and a specific command.

    Actually my xml data is built in a Metro apps as a String. Is there any way to sign this xml data directly in the Metro app source code  (like i found in the link given above) ?

    Thanks

    Christophe

    Thursday, April 26, 2012 11:08 PM
  • I am having a similar problem with the "Wi-Fi Hotspot Authentication sample".  I changed only the SSID and name in the WLANProfile section. 

    I signed the file using the ProvisioningTestHelper.psd1 tool in the SDK (as suggested by Dan from Mobidia).  I signed using the generated certificate "MBAPTestCert".

    I worked around the known issue by opening the signed xml file in Notepad and saving in ANSI encoding.

    I copied the signed xml file into the project, cleaned and rebuilt and run.  When I push the "Provision" button I get the following exception:

    System.Runtime.InteropServices.COMException occurred
      HResult=-2112421882
      Message=Exception from HRESULT: 0x82170006
      Source=mscorlib
      ErrorCode=-2112421882
      StackTrace:
           at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
           at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
           at HotspotAuthenticationSampleApp.MainPage.<OnButtonProvision>d__0.MoveNext() in c:\Users\kbarlow\Documents\Visual Studio 11\Projects\Wi-Fi hotspot authentication sample\C#\HotspotAuthenticationSampleApp\MainPage.xaml.cs:line 169
      InnerException:

    I have not been able to divine what HRESULT 0x82170006 is.

    I also tried the same procedure using the original ProvisioningData.xml (from the sample code) and I get the same result.

    I checked the xml and it is valid.

    Any ideas?

    Tuesday, May 1, 2012 12:27 AM
  • 0x82170006 (PROVCORE_E_XML_SIGNER_UNTRUSTED): Signer certificate is not trusted for provisioning

    Wireless team has confirmed that the Wi-Fi Hotspot sample is broken on Win8 Consumer Preview. You could use the web
    based provisioning.

    What I'm currently experimenting is to use my own test metadata package and write a privileged app to do the provisioning.

    • Proposed as answer by Kevin Barlow Wednesday, May 2, 2012 5:11 PM
    Wednesday, May 2, 2012 4:28 PM
  • Following is a simple html page with script that does the provisining,

    <!doctype html>
    <!-- saved from url=(0014)about:internet -->
    <html>
    <head>
    <script>
    function Log(logstring)
    {
    	var txtResult = document.getElementById("txtResult");
    	txtResult.innerText = logstring;
    }
    
    function LogException(e)
    {
    	Log("Exception: " + decimalToHexString(e.number) + " (" + e.toString() + ")");
    }
    
    function decimalToHexString(number)
    {
        if (number < 0)
        {
            number = 0xFFFFFFFF + number + 1;
        }
        return number.toString(16).toUpperCase();
    }
    
    function mapProvResultToString(provResultCode)
    {        
        var arrResultStrings = [
            "ProvisioningSuccess",
            "ProvisioningErrorGeneralFailure",
            "ProvisioningErrorInvalidSchema",
            "ProvisioningErrorNotSigned",
            "ProvisioningErrorInvalidSignature",
            "ProvisioningCancelled",
            "ProvisioningWiFiDeviceNotPresent",
            "ProvisioningMobileBroadbandDeviceNotPresent",
            "ProvisioningMultipleHardwareNotPresent"
            ];
    
        if (provResultCode < arrResultStrings.length)
        {
            return arrResultStrings[provResultCode];
        }
        else
        {
            return "Unknown";
        }
    }
    
    function testProvision()
    {
        try
        {
            var input = document.getElementById("inputProvXml");
            var result = window.external.msProvisionNetworks(input.value);
            Log(mapProvResultToString(result) + " (" + result + ")");
        }
        catch (e)
        {
            LogException(e);
        }
    }
    
    function download()
    {
    	var provUrl = document.getElementById("txtProvUrl").value;
    	try
    	{
    		Log("Downloading from " + provUrl);
    		var request = new XMLHttpRequest();
    		request.open("GET", provUrl, false);
    		request.send();
    		document.getElementById("inputProvXml").value = request.responseText;
    		Log("Download complete");
    	}
    	catch (e)
    	{
    		LogException(e);
    	}
    }
    </script>
    </head>
    <body>
    URL: <input type=text id="txtProvUrl"><input type=button onclick="download()" value="Download XML">
    <p>
    Provisioning XML:<br>
    <textarea id="inputProvXml" rows="10" cols="80"></textarea>
    <p>
    <input type=button onclick="testProvision()" value="Provision"/>
    <p>
    Result: <pre id="txtResult"/>
    </body>
    </html>

    Wednesday, May 2, 2012 4:31 PM
  • Thanks Dan!

    Where did you find the reference to the HRESULT error codes?

    Wednesday, May 2, 2012 5:12 PM
  • A few more of them, hope they will be helpful for people like us...

    0x82170001 (PROVCORE_E_XML_MALFORMED): XML is not well-formed

    0x82170002 (PROVCORE_E_XML_INVALID): XML does not match the provisioning schema

    0x82170003 (PROVCORE_E_XML_SIGNATURE_INVALID): XML signature is invalid

    0x82170004 (PROVCORE_E_XML_SIGNATURE_UNTRUSTED): Signer certificate is not chained to a trusted root CA

    0x82170005 (PROVCORE_E_XML_DIGEST_INVALID): XML has been tampered with

    0x82170006 (PROVCORE_E_XML_SIGNER_UNTRUSTED): Signer certificate is not trusted for provisioning

    0x82170007 (PROVCORE_E_NO_LEAF_CERT): No leaf certificate found in XML signature

    0x82170008 (PROVCORE_E_INTERFACE_NOT_PROVISIONED): Interface is not provisioned

    Got these from the wireless team directly. Unfortunately, these are not public. Microsoft should make them public!

    Wednesday, May 2, 2012 5:53 PM
  • A few more of them, hope they will be helpful for people like us...

    0x82170001 (PROVCORE_E_XML_MALFORMED): XML is not well-formed

    0x82170002 (PROVCORE_E_XML_INVALID): XML does not match the provisioning schema

    0x82170003 (PROVCORE_E_XML_SIGNATURE_INVALID): XML signature is invalid

    0x82170004 (PROVCORE_E_XML_SIGNATURE_UNTRUSTED): Signer certificate is not chained to a trusted root CA

    0x82170005 (PROVCORE_E_XML_DIGEST_INVALID): XML has been tampered with

    0x82170006 (PROVCORE_E_XML_SIGNER_UNTRUSTED): Signer certificate is not trusted for provisioning

    0x82170007 (PROVCORE_E_NO_LEAF_CERT): No leaf certificate found in XML signature

    0x82170008 (PROVCORE_E_INTERFACE_NOT_PROVISIONED): Interface is not provisioned

    Got these from the wireless team directly. Unfortunately, these are not public. Microsoft should make them public!

    thank you for the information.

    My program show 0x82170002, because I added <ConnectionMode> tag.


    kata.

    Wednesday, July 4, 2012 9:33 AM
  • Hi ,

    I'm getting the error code 80070057 while trying to provision. I'm using the Hotspot authentication sample application, with the below XML. (I have signed the XML, and removed the BOM character). Once I click provision, I also get disconnected from my wireless connection.

    when I use the html page provided by "Dan From Mobidia", I get a provisioning result successful, however the internet still gets disconnected, and I dunno where to go from there.

    Can anyone please help.

    here's my provisioning data.xml file

    <?xml version="1.0" encoding="utf-8"?>
    <CarrierProvisioning xmlns="http://www.microsoft.com/networking/CarrierControl/v1">
      <Global>
        <!-- Adjust the Carrier ID to fit your own ID. Refer to the MSDN documentation about Carrier ID's. -->
        <CarrierId>{9CFED7F0-7145-4D8F-8E11-332407A5509E}</CarrierId>
        <!-- Adjust the Susbscriber ID. Refer to the MSDN documentation about Subscriber ID's. -->
        <SubscriberId>1234567890</SubscriberId>
      </Global>
      <WLANProfiles>
        <WLANProfile xmlns="http://www.microsoft.com/networking/CarrierControl/WLAN/v1">
          <!-- Adjust the profile name to have a human readable network name. By default this equals the SSID. -->
          <name>TOTO-TATA</name>
          <SSIDConfig>
            <SSID>
              <!-- Adjust the SSID name to fit the SSID of the hotspot. -->
              <name>TOTO-TATA</name>
            </SSID>
          </SSIDConfig>
          <MSM>
            <security>
              <authEncryption>
                <authentication>WPA2PSK</authentication>
                <encryption>TKIP</encryption>
                <useOneX>false</useOneX>
              </authEncryption>
              <sharedKey>
                <keyType>passPhrase</keyType>
                <protected>true</protected>
                <keyMaterial>password</keyMaterial>
              </sharedKey>
              <HotspotProfile xmlns="http://www.microsoft.com/networking/WLAN/HotspotProfile/v1">
                <ExtAuth>
                  <!-- Adjust the extension ID to match the package family name of the application running the background task handler. -->
                  <ExtensionId>Microsoft.SDKSamples.HotspotAuthentication.CS_ymde27nf79f28!HotspotAuthenticationApp.App</ExtensionId>
                </ExtAuth>
              </HotspotProfile>
            </security>
          </MSM>
        </WLANProfile>
      </WLANProfiles>
    </CarrierProvisioning>

    Thank you

    Friday, July 6, 2012 7:43 AM
  • following on previous post, please note that I have disabled windows defender and windows firewall.

    thanks

    Friday, July 6, 2012 7:47 AM
  • Hello.

    Following the post, I still cann't run this sample correct...

    Is someone know the detail processes? Every step will be fine and helper...

    Tuesday, July 17, 2012 2:03 AM
  • hi, everybody.

    As we know, we can push the following profile info to system:

     
       <MSM>
            <security>
              <authEncryption>
                <authentication>WPA2PSK</authentication>
                <encryption>AES</encryption>
                <useOneX>false</useOneX>
              </authEncryption>
    		  <sharedKey>
    			<keyType>passPhrase</keyType>
    			<protected>false</protected>
    			<keyMaterial>password</keyMaterial>
    		  </sharedKey>
            </security>
          </MSM>

    But is there a way to push the following options to system? (auto connection mode and hide ssid)

    thanks!

    Tuesday, July 24, 2012 3:13 AM