diff --git a/public/Get-MatrixLoginToken.ps1 b/public/Get-MatrixLoginToken.ps1 index 66f0ed2..e7ebc95 100644 --- a/public/Get-MatrixLoginToken.ps1 +++ b/public/Get-MatrixLoginToken.ps1 @@ -1,9 +1,9 @@ <# .Synopsis - Login and retrieve an Access token. + Login and retrieve an Access token (returned as a SecureString). .Description - Login and retrieve an Access token from _matrix/client/v3/login. See https://spec.matrix.org/v1.2/client-server-api/#post_matrixclientv3login. + Login and retrieve an Access token from _matrix/client/v3/login (returned as a SecureString). See https://spec.matrix.org/v1.2/client-server-api/#post_matrixclientv3login. .Parameter ServerUrl URL for the Matrix server to log into, for example "https://matrix.example.com". @@ -35,11 +35,12 @@ function Get-MatrixLoginToken { } type = "m.login.password" password = $Credentials.Password | ConvertFrom-SecureString -AsPlainText + initial_device_display_name = "PSMatrix" } | ConvertTo-Json $res = Invoke-RestMethod -Uri "$ServerUrl/$apiPath" -Method $apiMethod -Body $reqBody - $token = $res.access_token | ConvertTo-SecureString + $token = $res.access_token | ConvertTo-SecureString -AsPlainText return $res.access_token } \ No newline at end of file