< Back

Get-PAuthkey

Sat Jan 18, 2020 7:26 pm

NAME Get-PAuthkey



SYNOPSIS

Returns access key, by sending a HTTPS POST request to https://<YOUR_SUBDOMAIN_HERE>.populiweb.com/api/.

All API requests (GET or POST) must include either the access_key as the Authorization header or the parameter

access_key.





SYNTAX

Get-PAuthkey [-PopuliUri] <String> [-Credential] <PSCredential> [[-Path] <String>] [<CommonParameters>]





DESCRIPTION

Returns access key, by sending a HTTPS POST request (we do not allow GET, since that could result

in your password being stored in Populi server logs) to https://<YOUR_SUBDOMAIN_HERE>.populiweb.com/api/.

If you have more than 15 failed login attempts in an hour, Populi will block your account for security reasons.

The account will need to be re-enabled by an Admin user in the Populi web interface.

Never store your API access key in an insecure place. If you have reason to believe your key has been compromised,

use the Populi interface to change the password of the associated account, then generate a new key.





PARAMETERS

-PopuliUri <String>

Set to the correct URL for your college (i.e. https://<YOUR_SUBDOMAIN_HERE>.populiweb.com/api/).

This parameter is required.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Credential <PSCredential>

Enter username and you will be prompted for password on execution of cmdlet.



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Path <String>

Enter the path to store the authkey. Remember to save in a secure location.



Required? false

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Returns PowerShell objects:

access_key

account_id

Optionally a text file with the access key given the path parameter.





NOTES





Author: Matthew Rehm

Creation Date: 12/13/2018



-------------------------- EXAMPLE 1 --------------------------



Get-PAuthkey -PopuliUri https://<YOUR_SUBDOMAIN_HERE>.populiweb.com/api/ -Credential <populi_username>



This will open an interactive window and prompt for <populi_password>.









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>$Credential = New-Object -TypeName System.Management.Automation.PSCredential



-ArgumentList '<populi_username>',('<populi_password' | ConvertTo-SecureString -AsPlainText -Force)

Get-PAuthkey -PopuliUri https://<YOUR_SUBDOMAIN_HERE>.populiweb.com/api/ -Credential $Credential









-------------------------- EXAMPLE 3 --------------------------



PS C:\\>Enter a path to save the authkey in a text file.



Get-PAuthkey -PopuliUri https://<YOUR_SUBDOMAIN_HERE>.populiweb.com/api/ -Credential <populi_username> -Path <path>











RELATED LINKS