How to programatically set up Wireless 802.1x connections using XML

kwierestit

New Member
I have been tasked to create a program to set up 802.1x wireless connections to assist users getting on wireless networks. I have run across the configuration xml used by the system. Below are two examples, the first is the profile setup:\[code\]<WLANProfile xmlns="http://www.microsoft.com/networking/WLAN/profile/v1"><name>%ProfileName%</name><SSIDConfig> <SSID> <name>%SSID_Name%</name> </SSID> <nonBroadcast>false</nonBroadcast></SSIDConfig><connectionType>ESS</connectionType><connectionMode>auto</connectionMode><autoSwitch>false</autoSwitch><MSM> <security> <authEncryption> <authentication>%AuthType%</authentication> <encryption>%Encryption%</encryption> <useOneX>true</useOneX> </authEncryption> <OneX xmlns="http://www.microsoft.com/networking/OneX/v1"> <cacheUserData>true</cacheUserData> <heldPeriod>1</heldPeriod> <authPeriod>18</authPeriod> <startPeriod>5</startPeriod> <maxStart>3</maxStart> <maxAuthFailures>3</maxAuthFailures> <supplicantMode>compliant</supplicantMode> <authMode>machineOrUser</authMode> <EAPConfig><EapHostConfig xmlns="http://www.microsoft.com/provisioning/EapHostConfig"><EapMethod><Type xmlns="http://www.microsoft.com/provisioning/EapCommon">25</Type><VendorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorId><VendorType xmlns="http://www.microsoft.com/provisioning/EapCommon">0</VendorType><AuthorId xmlns="http://www.microsoft.com/provisioning/EapCommon">0</AuthorId></EapMethod><Config xmlns="http://www.microsoft.com/provisioning/EapHostConfig"><Eap xmlns="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1"><Type>25</Type><EapType xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV1"><FastReconnect>true</FastReconnect><InnerEapOptional>false</InnerEapOptional><Eap xmlns="http://www.microsoft.com/provisioning/BaseEapConnectionPropertiesV1"><Type>26</Type><EapType xmlns="http://www.microsoft.com/provisioning/MsChapV2ConnectionPropertiesV1"><UseWinLogonCredentials>false</UseWinLogonCredentials></EapType></Eap><EnableQuarantineChecks>false</EnableQuarantineChecks><RequireCryptoBinding>false</RequireCryptoBinding><PeapExtensions><PerformServerValidation xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2">false</PerformServerValidation><AcceptServerName xmlns="http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2">false</AcceptServerName></PeapExtensions></EapType></Eap></Config></EapHostConfig></EAPConfig> </OneX> </security></MSM></WLANProfile>\[/code\]The second is the User Credentials setup:\[code\]<?xml version="1.0" ?> <EapHostUserCredentials xmlns="http://www.microsoft.com/provisioning/EapHostUserCredentials"xmlns:eapCommon="http://www.microsoft.com/provisioning/EapCommon" xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapMethodUserCredentials"><EapMethod> <eapCommon:Type>25</eapCommon:Type> <eapCommon:AuthorId>0</eapCommon:AuthorId> </EapMethod><Credentials xmlns:eapUser="http://www.microsoft.com/provisioning/EapUserPropertiesV1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:baseEap="http://www.microsoft.com/provisioning/BaseEapUserPropertiesV1" xmlns:MsPeap="http://www.microsoft.com/provisioning/MsPeapUserPropertiesV1" xmlns:MsChapV2="http://www.microsoft.com/provisioning/MsChapV2UserPropertiesV1"> <baseEap:Eap> <baseEap:Type>25</baseEap:Type> <MsPeap:EapType> <MsPeap:RoutingIdentity>%RoutingID%</MsPeap:RoutingIdentity> <baseEap:Eap> <baseEap:Type>26</baseEap:Type> <MsChapV2:EapType> <MsChapV2:Username>%UserName%</MsChapV2:Username> <MsChapV2:Password>%Password%</MsChapV2:Password> </MsChapV2:EapType> </baseEap:Eap> </MsPeap:EapType> </baseEap:Eap></Credentials>\[/code\]What I want most is the documentation of what all the tags are and how they are all used. I have been unable to find this information and only find minor bits of this on MSDN.My current problem is that I need to configure a network to use a certificate for authentication and then the user credentials part to select the certificate. Ideally when these are submitted to WlanSetProfile() and WlanSetProfileEapXmlUserData() respectively, then I can connect to the SSID without the user having to interact in any way.I did find this:\[code\]<eapTls:EapType><eapTls:Username>[email protected]</eapTls:Username> <eapTls:UserCert>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</eapTls:UserCert> </eapTls:EapType></baseEap:Eap>\[/code\]From some forum post. It looks like it might be relevant, but I do not know what the xxxx represent and exactly what else I may need. I assume this goes in the user credentials area somewhere.
 
Back
Top