0

I configured the Radius Server on Windows Server 2016 and I want to connect to Enterprise WiFi network using my application. I tried to do the following steps:

Set the profile without credentials using WlanSetProfile (I used imported profile from netsh with some modifications)

Then set the xml profile below with my username and password to WlanSetProfileEapXmlUserData:

<?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>26</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>26</baseEap:Type> 
       <MsChapV2:EapType>
         <MsChapV2:Username>test</MsChapV2:Username> 
         <MsChapV2:Password>test</MsChapV2:Password> 
       </MsChapV2:EapType>
     </baseEap:Eap>
   </Credentials>
 </EapHostUserCredentials>

Then I use WlanConnect function and callback function to verify the connection. When connecting I get the following issue:

NotificationCode returns code 8 (wlan_notification_acm_scan_fail) and then 11 (wlan_notification_acm_connection_attempt_fail).

Also, from MS docs:

wlan_notification_acm_scan_fail:

A scan for connectable networks failed.

The pData member of the WLAN_NOTIFICATION_DATA structure points to a WLAN_REASON_CODE data type value that identifies the reason the WLAN operation failed.

So, I checked the pData when this issue occurs and it returns the following reason:

wlan_notification_acm_scan_fail "The operation was successful."

But the network is not connected. Thanks in advance for your help.

6
  • Enterprise? You should ask the owners of the network. Or are you just saying you've set up a wireless network using an Enterprise authentication system? Commented Sep 29, 2019 at 20:58
  • @music2myear I have set up the Radius server on Win Server 2016 and try to connect to it. I checked the pData member of the WLAN_NOTIFICATION_DATA and it returns the following reason: wlan_notification_acm_scan_fail "The operation was successful." But the network is not connected. Thanks. Commented Sep 29, 2019 at 21:09
  • Then you need to explain that in the question itself. Saying you're connecting to "enterprise wifi" can mean many things, which makes your question difficult to understand as it is current written. Please improve the question to make it more clear. Commented Sep 30, 2019 at 1:20
  • @music2myear Ok. I have improved the question. I think it is more clear now. Thanks. Commented Sep 30, 2019 at 6:51
  • What is this application you are trying to connect to the wireless with? Commented Sep 30, 2019 at 23:47

1 Answer 1

0

I have fixed this issue. The problem was because the PerformServerValidation was set to true and it displayed the notification dialog to verify the certificate on Windows that's why it returned:

wlan_notification_acm_scan_fail "The operation was successful."

Setting the PerformServerValidation to false fixed the issue (WlanSetProfile function).

<PerformServerValidation xmlns=\"http://www.microsoft.com/provisioning/MsPeapConnectionPropertiesV2\">false</PerformServerValidation>

Also, for WlanSetProfileEapXmlUserData function I provided this profile:

<?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>
<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>
</EapHostUserCredentials>

Now it connects successfully to Enterprise network. The issue is resolved. Thank you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .