okta / okta-powershell-cli

Powershell CLI for communicating with the Okta API
Other
17 stars 5 forks source link

PowerShell verbs #38

Open gabrielsroka opened 5 months ago

gabrielsroka commented 5 months ago

should https://github.com/okta/okta-powershell-cli/blob/main/docs/OktaUserApi.md#Rename-OktaPassword be called Set-OktaUserPassword, analogous to https://learn.microsoft.com/en-us/powershell/module/azuread/set-azureaduserpassword?view=azureadps-2.0 ?

see also https://learn.microsoft.com/en-us/powershell/scripting/developer/cmdlet/approved-verbs-for-windows-powershell-commands

eg

Suspend Pauses an activity. For example, the Suspend-Service cmdlet pauses a service. This verb is paired with Resume.

also https://github.com/okta/okta-powershell-cli/blob/main/docs/OktaUserApi.md, etc, has links to https://github.com/okta/okta-powershell-cli/blob/main/README.md#apiToken which don't work. does the CLI support API Tokens?

laura-rodriguez commented 5 months ago

Hi @gabrielsroka,

Thanks for reporting this issue. Since this module is generated from the Open API spec, we'll have to dig into the OpenAPI spec and codegen tooling to see why this particular command doesn't follow the PowerShell Verbs guidelines. I have filed an internal ticket to address this issue so it can be reviewed and prioritized during team planning.

Although passing an API token to the module may be possible, we don't officially support it, and we encourage everyone to use OAuth.

Internal Ref: OKTA-727804

mpsny commented 3 weeks ago

@laura-rodriguez, can you get a solid answer from the devs on if and how its possible to use an API Token with the Okta.PowerShell module, instead of having to login every time you want to use the module? I'm sure many admins would like to truly automate tasks, and having to login manually is not automation.

gabrielsroka commented 3 weeks ago

you totally can. i thought i shared the steps and the concern a few months ago. lemme find it.

gabrielsroka commented 3 weeks ago

i think this is it. lemme test it some more

$Configuration = Get-OktaConfiguration
$Configuration.BaseUrl = 'https://YOURORG.okta.com'
$Configuration.DefaultHeaders = @{authorization = 'SSWS TOKEN'}

Get-oktaUser gabrielsroka
gabrielsroka commented 3 weeks ago

it worked with v.1.0.1. i'm updating it and testing again.

gabrielsroka commented 3 weeks ago

yep, it works with 1.0.2, too.

gabrielsroka commented 3 weeks ago

oh, yep. i did share it here :)

https://github.com/okta/okta-powershell-cli/issues/40#issue-2278296233

mpsny commented 3 weeks ago

Awesome, thank you! I did not see the other post.