AnnyConnect API - C# - Connect without UI (Windows Service)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2017 08:14 AM - edited 03-12-2019 04:32 AM
I am trying to create a windows service / console app that will establish a VPN connection, perfom some actions, and then close the vpn connection. This will happen many time throughtout the day.
There will be no user interaction so I need the connection to be established from the code (service).
In addtion, I would like to monotor the connection while it is open.
It looks like using the VpnApiLib (Interop.VpnApiLib) will do what I need, however I can not seem to find documentation on how to establish the connection without the AnyConnect UI poping up for credentials.
The connection requires a Group, UserName and Password that I will provide from code (securly!)
Can anyone point me to some documentation / examples of how this can be accomplished. I am open to other options. I believe I can do this by starting a process and capturing the output, but I would prefer a more robust solution.
Quick Edit..
I am refering to and using the VpnApiClass. Using CSharpComSample as a reference.
It woudl seem that this would be a fairly common thing to acomplish. Surprised I am not finding a solution out there.
Thanks,
Ben.
- Labels:
-
Other VPN Topics
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2017 07:01 PM
The easiest I think of is to replace your credentials authentication with certificate authentication. this config to be done on your AnyConnect server.
Then using client certificate anyconnect will automatically authenticate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2017 08:07 PM
