Skip to content

Commit a47c3bc

Browse files
authored
Update Parameter names to reference newer Application names (#2)
1 parent 6e60858 commit a47c3bc

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

PSF.psm1

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ function Get-oAuthToken {
55
.DESCRIPTION
66
This Function connects to the Microsoft AAD OAuth endpoint and generates an OAuth token.
77
This token can then be used for authentication against the resource supplied In the parameters.
8-
.PARAMETER ClientID
9-
The ClientID of the application used for authentication against Azure AD.
10-
.PARAMETER ClientSecret
8+
.PARAMETER ApplicationId
9+
The ApplicationId of the application used for authentication against Azure AD.
10+
.PARAMETER ApplicationKey
1111
The Key generated within the application used for authentication against Azure AD.
1212
This key should have rights to the resource supplied in the ResourceName parameter.
1313
.PARAMETER TenantId
1414
The TenantId of the Azure AD that you wish to authenticate against.
1515
.PARAMETER ResourceName
1616
The name of the resource that you want to generate a token for.
1717
.EXAMPLE
18-
Get-ApiToken -ClientID '12345678-9012-3456-7890-123456789012' -ClientSecret 'AfXooIr8rswX24yrFXMrO4SbBgutwTtojAZEpQOaaaa=' -TenantId 'abcd4ffb-d0bc-1234-854a-114710c94dbb' -Resource 'https://test.onmicrosoft.com/apitest'
18+
Get-ApiToken -ApplicationId '12345678-9012-3456-7890-123456789012' -ApplicationKey 'AfXooIr8rswX24yrFXMrO4SbBgutwTtojAZEpQOaaaa=' -TenantId 'abcd4ffb-d0bc-1234-854a-114710c94dbb' -Resource 'https://test.onmicrosoft.com/apitest'
1919
.NOTES
20-
Version 1.1
20+
Version 1.2.0
2121
#>
2222
[Cmdletbinding()]
2323
Param(
24-
[Parameter(Mandatory = $true)][string]$ClientID,
25-
[Parameter(Mandatory = $true)][string]$ClientSecret,
24+
[Parameter(Mandatory = $true)][string]$ApplicationId,
25+
[Parameter(Mandatory = $true)][string]$ApplicationKey,
2626
[Parameter(Mandatory = $true)][string]$TenantId,
2727
[Parameter(Mandatory = $false)][string]$ResourceName = "https://graph.windows.net",
2828
[Parameter(Mandatory = $false)][boolean]$ChinaAuth = $false
@@ -38,7 +38,7 @@ function Get-oAuthToken {
3838
}
3939

4040
#Get an Oauth 2 access token based on client id, secret and tenant id
41-
$Body = @{grant_type = "client_credentials"; resource = $ResourceName; client_id = $ClientID; client_secret = $ClientSecret}
41+
$Body = @{grant_type = "client_credentials"; resource = $ResourceName; client_id = $ApplicationId; client_secret = $ApplicationKey}
4242
$AuthContext = Invoke-RestMethod -Method Post -Uri $LoginURL/$TenantId/oauth2/token?api-version=1.0 -Body $Body
4343
Return "$($AuthContext.token_type) $($AuthContext.access_token)"
4444
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy