-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0ebdc1d
commit cc58e22
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Gain your token by heading to your NordVPN account and going to "Get Access Token" | ||
# URL: https://my.nordaccount.com/dashboard/nordvpn/access-tokens/authorize/ | ||
$username = "token" | ||
$password = "my-token-from-nordvpn" | ||
$auth = "$($username):$($Password)" | ||
$bytes = [System.Text.Encoding]::ASCII.GetBytes($auth) | ||
$encodedCredentials = [Convert]::ToBase64String($bytes) | ||
$url = "https://api.nordvpn.com/v1/users/services/credentials" | ||
|
||
$headers = @{ | ||
Authorization = "Basic $encodedCredentials" | ||
} | ||
|
||
# Prints out Username, Password, and Nordlynx Private Key (this is what you need for Wireguard) | ||
Invoke-RestMethod -Uri $url -Headers $headers -Method Get | ||
|
||
# ****IGNORE - MIGHT BE OF USE FOR SCRIPTING******* | ||
# Send the GET request and capture the result | ||
# $response = Invoke-RestMethod -Uri $url -Headers $headers -Method Get | ||
|
||
# Output specific properties | ||
# $response | Select-Object id, created_at, updated_at, username, password, nordlynx_private_key | ||
|
||
# Optionally, you can access individual properties like this: | ||
# Write-Output "ID: $($response.id)" | ||
# Write-Output "Username: $($response.username)" | ||
# Write-Output "Password: $($response.password)" | ||
# Write-Output "NordLynx Private Key: $($response.nordlynx_private_key)" |