< Back

Get-OktaSessionToken

Sat Jan 18, 2020 5:46 pm

NAME Get-OktaSessionToken



SYNOPSIS

Gets an Okta Session Token.





SYNTAX

Get-OktaSessionToken [-OktaDomain] <String> [-Credential] <PSCredential> [[-MFAType] <String>] [[-MFACode]

<String>] [<CommonParameters>]





DESCRIPTION

Gets and Okta Session Token. Okta Session Tokens are valid initial

logons to Okta and cannot be used to directly access integrated

applications.





PARAMETERS

-OktaDomain <String>

The full Okta account domain. Example: mycompany.okta.com



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Credential <PSCredential>

PSCredential to use for logon. If unspecified a GUI prompt will be

issued.



Required? true

Position? 2

Default value ( Get-Credential )

Accept pipeline input? false

Accept wildcard characters? false



-MFAType <String>



Required? false

Position? 3

Default value push

Accept pipeline input? false

Accept wildcard characters? false



-MFACode <String>



Required? false

Position? 4

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



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



PS C:\\>Get-OktaSessionToken -OktaDomain 'mycompany.okta.com' -Credential ( Get-Credential )













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



PS C:\\>Get-OktaSessionToken -OktaDomain 'mycompany.okta.com' -Credential ( Get-Credential ) -MFAType

token:software:totp -MFACode 123456













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



PS C:\\>Get-OktaSessionToken -OktaDomain 'mycompany.okta.com' -Credential ( Get-Credential ) -MFAType sms















RELATED LINKS

https://github.com/bad2beef/AWSLogin