Skip to content

Commit

Permalink
TssSession - Correct issue found on SessionRefresh
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmelton committed Apr 2, 2021
1 parent 62ff8c6 commit 83d6533
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
11 changes: 6 additions & 5 deletions docs/collections/_abouttopics/about_tsssession.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,18 @@ last_modified_at: 2021-02-15T00:00:00-00:00
TokenType:
Based on the authentication method (possible values: bearer, ExternalToken, or WindowsAuth)

StartTime:
Current date and time when session was created
Hidden property

ExpiresIn:
Authentication token expiration time, in seconds

StartTime:
Current date and time when session was created

TimeOfDeath:
Expiration date and time based on ExpiresIn value.
Provides the time when the authentication token will no longer be valid.
Hidden property

Take:
Endpoints that allow paging, defaults to max value allowed

# METHODS

Expand Down
2 changes: 1 addition & 1 deletion docs/collections/_docs/01-authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ More: [How to Secure Your Passwords with PowerShell](https://www.sqlshack.com/ho

### SecretManagement Module

Microsoft's PowerShell Team has released a module that offers an efficient, secure, and easily managed option to the other methods commonly used for securely storing your OAuth2 username and password in PowerShell.
Microsoft's PowerShell Team's [SecretManagement](https://devblogs.microsoft.com/powershell/secretmanagement-and-secretstore-are-generally-available/) modules give you a universal abstraction layer for management of credentials that you need to use in your scripts on a given machine. These modules are cross-platform and can be used on **any** operating system that Windows PowerShell or Powershell 7+ are supported. Your admins can leverage these two modules to more secure store the OAuth2 credential needed for authenticating with Secret Server's.

More:

Expand Down
10 changes: 4 additions & 6 deletions src/classes/auth/TssSession.class.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ class TssSession {
[string]
$TokenType

hidden
[datetime]
$StartTime

[int]
$ExpiresIn

hidden
[datetime]
$StartTime

[datetime]
$TimeOfDeath

Expand Down Expand Up @@ -94,7 +92,7 @@ class TssSession {
return $false
}
try {
$url = $this.SecretServer + 'oauth2/token' -join '/'
$url = $this.SecretServer, 'oauth2', 'token' -join '/'
$body = @{
refresh_token = $this.RefreshToken
grant_type = 'refresh_token'
Expand Down
11 changes: 6 additions & 5 deletions src/en-us/about_tsssession.help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,18 @@ PROPERTIES
TokenType:
Based on the authentication method (possible values: bearer, ExternalToken, or WindowsAuth)

StartTime:
Current date and time when session was created
Hidden property

ExpiresIn:
Authentication token expiration time, in seconds

StartTime:
Current date and time when session was created

TimeOfDeath:
Expiration date and time based on ExpiresIn value.
Provides the time when the authentication token will no longer be valid.
Hidden property

Take:
Endpoints that allow paging, defaults to max value allowed

METHODS

Expand Down

0 comments on commit 83d6533

Please sign in to comment.